# Enable Automated Inbound PVA Activity Email Processing

With the 26R1 release, SafetyDocs automates the receipt and processing of inbound PVA obligation activities from partners, generating auditable documents for emails and attachments and assigning them to the appropriate _PVA Activity_. This automation boosts operational efficiency and compliance by ensuring faster processing, immediate status updates, and transparent communication for partners.

After you have enabled this feature, see the following articles for more information:
* <a href="/en/lr/01242/#automated-intake">Manage Pharmacovigilance Agreements</a>
* <a href="/en/lr/928422/">Manage PVA Multi-Agreement Activities</a>

## Prerequisites
Before enabling this feature in your Vault, you must <a href="/en/lr/01324/">enable PVA Management</a>.  To enable this feature for _PVA Multi-Agreement Activities_, you must also <a href="/en/lr/927259/">enable Multi-Agreement Activities</a>.

## Overview
To configure this feature in your Vault:
* [Update object layouts][1]
* [Configure _PVA Activity_ actions][2]
* [Configure a _PVA Multi-Agreement Activity_ action][3]
* [Update the _PVA Activity Inbound_ workflow][4]
* [Create an _Inbound Email Address_][10]
* Optional: [Configure the standard _Notification Templates_][11] to modify the messaging Vault uses to notify your senders and recipients in specific inbound _PVA Activity_ scenarios
* Optional: <a href="/en/lr/827001/">Create _Schedule_ records</a> for your scheduled _PVA Obligations_

## Update Object Layouts {#update-object-layouts}
To update the _PV Agreement_ layout, <a href="/en/lr/26387/#how-to-add-object-fields">add</a> the _Inbound Email Address_ field below the _PVA Outline_ field.

To update the _PVA Activity_ layout:
1. <a href="/en/lr/26387/#how-to-add-object-fields">Add</a> the _Activity Inbound Email Address_ field below the _Partner Responsible Contact_ field.
2. For the _Inbound No Email Intake_ <a href="/en/lr/51632/">layout rule</a>, set the **Status** to **Active**.
3. Update the existing _Outbound Activity_ layout rule. In the _Apply the following display effects_ section, add a new display effect as follows: 
    * **Effect**: Select **Hide**
    * **Type**: Select **Fields**
    * **Value**: Select **Activity Inbound Email Address**

## Configure PVA Activity Actions {#pva-activity-actions}
<a href="/en/lr/43127/#assign-actions">Assign</a> the following actions to the _PVA Activity_ object:
* _Send Documents Received to Partner_
* _Send Documents Received to Sponsor_
* _Send Inbound Activity Reminder_
* _Send Activity Rework to Partner_
* _Send Activity Complete to Partner_

Then, add each action as a <a href="/en/lr/59885/#define-actions">user action</a> or <a href="/en/lr/59885/#entry-actions">entry action</a> on the _PVA Activity Lifecycle_ as follows:

<table>
  <thead>
    <tr>
      <th>Lifecycle State</th>
      <th>Action Type</th>
      <th>Action Conditions</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><em>New</em></td>
      <td>User action</td>
      <td>
        <ul>
          <li><strong>Condition Type</strong>: Select <strong>All conditions are met</strong></li>
          <li><strong>If</strong>: Select <strong>Activity Inbound Email Address > is not blank</strong></li>
          <li><strong>Allow the following actions</strong>:
            <ul>
              <li>Select <strong>Send Inbound Activity Reminder</strong></li>
              <li><strong>Action Label</strong>: Enter <code>Send Inbound Activity Reminder</code></li>
            </ul>
          </li>
        </ul>
      </td>
    </tr>
    <tr>
      <td rowspan="2"><em>Received from Partner</em></td>
      <td>Entry action</td>
      <td>
        <ul>
          <li><strong>Condition Type</strong>: Select <strong>All conditions are met</strong></li>
          <li><strong>If</strong>: Select <strong>Activity Inbound Email Address > is not blank</strong></li>
          <li><strong>perform actions</strong>: Select the following actions:
            <ul>
              <li><strong>Send Documents Received to Partner</strong></li>
              <li><strong>Send Documents Sponsor</strong></li>
            </ul>
          </li>
        </ul>
      </td>
    </tr>
    <tr>
      <td>User action</td>
      <td>
        <ul>
          <li><strong>Condition Type</strong>: Select <strong>Always</strong></li>
          <li><strong>Allow the following actions</strong>:
            <ul>
              <li>Select <strong>Workflow > PVA Activity Inbound</strong></li>
              <li><strong>Action Label</strong>: Enter <code>Review and Approve Partner Documents</code></li>
            </ul>
          </li>
        </ul>
      </td>
    </tr>
    <tr>
      <td><em>Inbound Activity Requires Follow Up</em></td>
      <td>Entry action</td>
      <td>
        <ul>
          <li><strong>Condition Type</strong>: Select <strong>All conditions are met</strong></li>
          <li><strong>If:</strong> Select <strong>Activity Inbound Email Address > is not blank</strong></li>
          <li><strong>perform actions</strong>: Select <strong>Send Activity Rework to Partner</strong></li>
        </ul>
      </td>
    </tr>
    <tr>
      <td><em>Complete</em></td>
      <td>Entry action</td>
      <td>
        <ul>
          <li><strong>Condition Type</strong>: Select <strong>All conditions are met</strong></li>
          <li><strong>If</strong>: Select <strong>Activity Inbound Email Address > is not blank</strong></li>
          <li><strong>perform actions</strong>: Select <strong>Send Activity Complete to Partner</strong></li>
        </ul>
      </td>
    </tr>
  </tbody>
</table>

## Configure PVA Multi-Agreement Activity Action {#pva-maa-action}
To configure the _Send Inbound Activity Reminders_ user action:
1. <a href="/en/lr/43127/#assign-actions">Assign</a> the _Send Inbound Activity Reminders_ action to the _PVA Multi-Agreement Activity_ object.
2. Add the action as a <a href="/en/lr/59885/#define-actions">user action</a> on the _In Progress_ state of the _PVA Multi-Agreement Activity Lifecycle_ using the following conditions:
    * **Condition Type**: Select **Always**
    * **Allow the following actions**:
        * Select **Send Inbound Activity Reminders**
        * **Action Label**: Enter `Send Inbound Activity Reminders`

## Update the PVA Activity Inbound Workflow {#update-workflow}
To update the _PVA Activity Inbound_ workflow:
1. Navigate to **Admin > Configuration > Workflows > PVA Activity Inbound**.
2. Update the following workflow steps:
    * [_SC: Received_][5]
    * [_Task: Verify Received Documents_][6]
    * [_Decision: Complete Activity?_][7]
    * [_SC: Partner Follow Up_][8]
3. [Activate the workflow][9].

### Update the SC: Received Step {#sc-received}
To update the _SC: Received_ workflow step:
1. In the _Workflow Steps_ section, select **SC: Received**.
2. Select **Edit**.
3. Update the **Label** value to `SC: In Review`.
4. In the _Rules_ section, update the **Lifecycle State** value to **Partner Documents In Review**.
5. Select **Save**, then navigate back to the _PVA Activity Inbound_ workflow.

### Update the Task: Verify Received Documents Step {#task-verify-received}
To update the _Task: Verify Received Documents_ workflow step:
1. In the _Workflow Steps_ section, select **Task: Verify Received Documents**.
2. Select **Edit**.
3. In the _Prompts_ section, select the **Prompt for Verdicts** checkbox, then configure the following verdicts:
    * **Verdict Label**: Enter `All Documents Received`
    * Select **Add Verdict**, then configure the verdict as follows:
        * **Verdict Label**: Enter `Additional Follow Up Required`
            * Select **Add Field Prompts**:
                * **Prompt for Fields**: Select **Partner Corrections Needed**
                * Select the **Required** checkbox
4. In the **Next Steps** field:
    * Remove the **SC: Complete** step
    * Select **Create Step**
    * In the **Step Name** field, enter `Decision: Complete Activity?`
    * Select **OK**
5. Select **Save**.
6. From the _Next Steps_ field, select **Decision: Complete Activity?** to navigate to the next step.

### Define the Decision: Complete Activity Step {#decision-complete-activity}
To define the _Decision: Complete Activity?_ step:
1. From the _Decision: Complete Activity?_ step page, select **Edit**.
2. For **Type**, select **Decision**.
3. In the _Rules_ section, select **Create Rule** and populate the fields as follows:
    * **Condition Type**: Select **All conditions are met**
    * **if**: Select **Task > Task: Verify Received Documents > all labels equal > All Documents Received**
    * **then**: Select **SC: Complete**
4. In the **then** field of the _Else_ section, select **Create Step**.
    * In the _Create Step_ dialog, enter `SC: Partner Follow Up`
    * Select **OK**
5. Select **Save**.
6. In the _Rules_ section, select **SC: Partner Follow Up** to navigate to the next step.

### Define the SC: Partner Follow Up Step {#sc-partner-follow-up}
To define the _SC: Partner Follow Up_ step:
1. From the _SC: Partner Follow Up_ step page, select **Edit**.
2. In the _Details_ section, populate the fields as follows:
    * **Type**: Select **Action**
    * **Next Steps**: Select **End**
3. In the _Rules_ section, select **Create Rule** and populate the fields as follows:
    * **Condition Type**: Select **Always**
    * **perform actions**: Select **Change State**
    * **Lifecycle State**: Select **Inbound Activity Requires Follow Up**
4. Select **Save**.

### Activate the Workflow {#activate-workflow}

To activate the updated _PVA Activity Inbound Workflow_ workflow:
1. Navigate to the main page of the workflow.
2. In the _Status_ field within the _Details_ section, select **Make configuration active**.

## Create an Inbound Email Address {#create-inbound-email-address}
To allow Vault to <a href="/en/lr/01242/#automated-intake">handle _PVA Activity_ documents received via email</a>, you must <a href="/en/lr/74285/#creating-inbound-email-addresses">create an _Inbound Email Address_</a>. When creating the _Inbound Email Address_, consider the following:
* **Email Address**: Ensure the value before the @ symbol is 42 characters or less. If this value exceeds this limit, Vault cannot generate _PVA Activity_ documents received via email.
* **Email Processor**: Select **Create PVA Inbound Obligation From Email**.
* **Send Bounce Notification**: We recommend selecting this checkbox.

## Configure Notification Templates {#notification-templates}
This feature introduces a number of _Notification Templates_, which you can configure to suit your business needs:
* _PVA Inbound Activity Created_
* _PVA Activity Docs Received_
* _PVA Acknowledge Inbound Docs Received_
* _PVA Inbound Activity Completed_
* _PVA Inbound Activity Rework_
* _PVA Inbound Activity Generic Error_
* _PVA Inbound Activity Completed Error_
* _PVA Inbound Activity Attachment Error_

To configure a _Notification Template_:
1. Navigate to **Admin > Configuration > Notification Templates > [Notification Template]**.
2. Select **Edit**.
3. On the _Create Notification Template_ page, modify the <a href="/en/lr/2157/#tokens">relevant fields</a> as required for your business processes.
4. Select **Save**.

[1]: #update-object-layouts
[2]: #pva-activity-actions
[3]: #pva-maa-action
[4]: #update-workflow
[5]: #sc-received
[6]: #task-verify-received
[7]: #decision-complete-activity
[8]: #sc-partner-follow-up
[9]: #activate-workflow
[10]: #create-inbound-email-address
[11]: #notification-templates