Skip to main content

Email to Interaction

Organizations can trigger the automatic creation of Medical Inquiries within the Medical Information Cloud Inquiry Management module through the use of email. When configured, any time registered email addresses are included on an email in the To, CC, or BCC address lines, custom processing is invoked to ensure a corresponding Interaction (Case) is created with the relevant data to correctly route the Interaction to the appropriate groups for subsequent processing. All inbound email attachments from Adverse Events, Product Quality Complaints, Requests, and Fulfillments are attached back to the record instead of only to the Interaction.

To configure the custom Apex email service, perform the following steps:

  1. Set up email service for your corporate domain:

    1. In the Quick Find box in Setup, search for and select Email Services.

    2. If an email service does not already exist in Medical Information Cloud, click New email service and fill out the fields in the Email Service Information section as shown in the table below.

      Field

      Recommended value

      Required value

      Email Service Name

      MED Email Handler

       

      Apex Class

      MED_InboundEmailHandler

      Accepts Attachments

      All

      Advanced Email Security Settings

      Note

      While it is recommended you turn this on to reduce spam, it may cause some emails to be rejected erroneously. Visit Salesforce's Define Email Services topic for more information.

      Selected

      Accept Email From

      Leave blank to receive all email addresses (subject to security settings).

      Convert Text Attachments to Binary Attachments

      Selected

      Active

       

      Selected

      Note

      Komodo Health recommends that at a minimum, Failure Response settings to be set to Bounce message. Komodo Health further recommends you enable requeue (when applicable) and set "Enable Error Routing" to send emails to a monitored email box to facilitate notifications of issues. For more information, reference the Failure Response Settings section below.

    3. Set Failure Response Settings as shown in the table below.

      Field

      Recommended Value

      Required Value

      Over Email Rate Limit Action

      Requeue

      Deactivated Email Address Action

      Bounce

      Deactivated Email Service Action

      Bounce

      Unauthenticated sender action

      Bounce

      Unauthorized sender action

      Bounce

      Enable Error Routing

      Selected

      Route Error Emails to This Email Address

      A monitored email address. Error handling emails will go here and nowhere else.

      Warning

      Failure to set failure response settings will cause data loss. Salesforce's default settings will discard emails with no log, history, or reason.

    4. Click Save.

    5. Navigate to the Global Setting (MED_Global_Setting__mdt) custom metadata type.

    6. Click Manage Global Settings.

    7. Click Global Setting.

    8. Under the General Settings section, enter the domain to be used in Email Services in the Email Service Domain field (e.g., mydomain.com).

    9. Click Save.

  2. Create new email addresses under the domain:

    1. Navigate back to Email Services in Setup and select the email handler that the new email addresses will live under.

    2. Click New Email Address and fill out the fields in the Email Address Information section as shown in the table below.

      Field

      Value

      Email Address Name

      Unique name for the email address.

      Email address

      The local name of the email address (i.e., if the email address is support@mydomain.com, the local name is support).

      Active

      Selected

      Context User

      The user who can create cases, requests, email messages, and search all accounts. It is recommended to use an integration user for this.

      Note

      Case assignment rules will be run when the case is created.

      Accept Email From

      Blank to receive all email addresses.

    3. Click Save. The new email address(es) and Email Service Domain will be listed under the Email Addresses section. Copy the long Salesforce generated email address.

    4. Create an organization-wide email address for your new email address (e.g., support@mydomain.com).

    5. Set up email forwarding on your email server to forward emails from the new email address (e.g., support@mydomain.com) to the long Salesforce generated email address (e.g., support@s-277kk53j2f8thrl1zyoqg4r8j31mdso3kdtmljo708mrtwuilb.8b-2lfijao34.as62.apex.sandbox.salesforce.com).

    6. (Optional) Set a default country when new Interactions (Cases) are created by entering the full email address (e.g., support@mydomain.com) in the Email2Case Emails field in the Local Settings record linked to the desired default country.

Failure Response Settings

The failure response settings determine how the email service responds should an attempt to access the service fails. Configuring response options is required to prevent the loss of emails.

Failure types include:

  • Over Email Rate Limit Action

  • Deactivated Email Address Action

  • Deactivated Email Service Action

  • Unauthenticated Sender Action

  • Unauthorized Sender Action

Failure response options are:

  • Bounce message

  • Discard message

  • Requeue message (over email rate limit action only)

For more details on the above Failure Response settings, visit Salesforce's Define Email Services documentation.

To configure response options:

  1. In Setup, search for and select Email Services.

  2. Click Edit next to the desired Email Service.

  3. For each failure type, select a response action from the dropdown options: Discard message, Bounce message, Requeue message.

  4. Click Save.