# Configuring Complaint Email Ingestion (QMS)

This article explains the Admin setup required to enable your Vault to automatically process incoming complaint emails and create object records containing all complainant-provided information and attachments. Once set up, QMS can automatically create a _Complaint_ record or a [_Complaint Intake_ record](/en/lr/928400/) when an email is received.

## Configuration Overview

To set up automated complaint record creation from email, configure the following Vault components:

  * Create an Inbound Email Address for each type of complaint.
  * For each _Inbound Email Address_, add an _Inbound Email Address Configuration_.
  * Add the special _Email Body_ section or _Email Body_ field to the _Complaint Email_ object type [page layout](/en/lr/26387/#how-to-add-sections). The _Email Body_ section and field display up to 32,000 characters. If the _Email Body_ content exceeds 32,000 characters, the section displays a warning message in Vault and on [downloaded PDFs](/en/lr/44069/#download-as-pdf), while the _Email Body_ field displays a truncated version of the email text in Vault. Users can view and download the full email in the record's _Attachments_ section.

## Creating Inbound Email Addresses for Complaint Email Ingestion

You must [set up an email inbox](/en/lr/74285/#creating-inbound-email-addresses) for each type of complaint that you may receive. For each inbox, fill in the _Email Address_ which will be provided to potential complainants for this type of complaint, and select the _Create Complaint_ email processor. Select a user with adequate permissions as the _Email Processor User_.

## Creating Inbound Email Address Configurations for Complaint Email Ingestion

For each _Inbound Email Address_ you have set up, create an _Inbound Email Address Configuration_. To create an _Inbound Email Address Configuration_ for complaint email ingestion:

  1. Navigate to **Admin > Configuration > Inbound Email Address Configurations**.
  2. Click **Create**.
  3. Fill in a **Label**.
  4. Select a **Status**. If the configuration is _Inactive_, Vault will not create complaints from emails sent to this address.
  5. Select an **Inbound Email Address**. The drop-down only contains _Inbound Email Addresses_ that have been set up and are not selected in any other _Inbound Email Address Configurations_. When you select an _Inbound Email Address_, Vault adds its indicated _Email Processor_ value automatically.
  6. Select the appropriate **Object**: The standalone _Complaint_ object, if your Vault uses the standalone _Complaint_ data model option, the _Complaint Intake_ object, or the _Quality Event_ object.
  7. Select an **Object Type**. When an email is received, the email processor creates a record of the selected object type. The _MedTech Complaint Intake_ object type on the _Complaint Intake_ object is not supported.
  8. Optional: Select one (1) of the following parsing options:
     1. **Disable Email Body and Text Parsing**: Selecting this checkbox prevents the email processor from attempting to parse and copy content from the incoming email's body text to the _Email Body_ and _Email Text_ fields, or to the _Email Body_ section, on the resulting _Complaint_ record.
     2. **Disable Email and Attachments Parsing**: Selecting this checkbox prevents Vault from adding the original email and attachments to the resulting _Complaint_ record.
  9. Optional: Select one (1) of the following **Email Thread Detection** options to identify whether a _Complaint_ record has already been created from an email in an email thread:
     1. **Match on Message ID**: Vault uses the _Message ID_, a unique identifier assigned to each individual email message, to locate records that were previously processed by an email processor. If no option is selected, Vault uses the _Message ID_ by default.
     2. **Match on Root Message ID**: Vault uses the _Root Message ID_, the first _Message ID_ in the _References_ header of an email thread, to locate records that were previously processed by an email processor. When multiple emails have the same _Root Message ID_, Vault associates the newly processed email with the latest record with the same _Root Message ID_.
  10. Click **Save**.

## Related Permissions

The _Email Processor User_ that is utilized to perform the actions when the _Create Complaint Email Processor_ action executes must have _Read_ permissions on the following objects: _Email_, _Person_, _Complaint_, _Complaint Intake_, and _Quality Event_
