Loading

Import Email Messages in bulk and relate them to Contacts

Veröffentlichungsdatum: Sep 6, 2023
Beschreibung

Data Loader can be used to insert Email Message records and associate them to Contacts so they're displayed in their Activity Timeline or Activity History.

Note: This is only possible through insert via API.


See also
Email Message
Email Message Relation 

 
Lösung


A. Export the Email Message

 
  1. Export Email Message via Data Loader. You may add a criterion for the “ID equals (Contact ID for the source of the Email Message).” If your email records came from another CRM, you may proceed to step 2.
  2. Create a csv file with the following column headers:
 
  • From Address
  • From Name
  • To Address
  • CC Address
  • BCC Address
  • Is Incoming
  • Message Date
  • Status
  • Headers
  • Subject
  • Text Body
  • HTML Body
 
If the email message was exported from Salesforce or other CRM. You would need to manipulate the data by removing the Id and changing the 'From Address' field to the target Contact email address.
 
Note: If you need to have actual created date and last modified date, see Enable the 'Create Audit Fields' permission.
 
  1. Once done with preparing the csv file, login to Data Loader.
 

B. Insert Email Message records to Salesforce

 
  1. Start the Data Loader and use the "Insert" function.
  2. Log in with your credentials. Note that you may have to use a Security token for this. Click Next after authentication.
  3. Select the Show all Salesforce objects box and select the object Email Message (EmailMessage).
  4. Browse the csv file (the one from step A) and click Next.
  5. Click OK on the confirmation window that indicates the number of records to be processed.
  6. On the next page, click Create or Edit a Map.
  7. On the Mapping screen, click Auto-Match Fields to Columns and click OK (Note: Do not map the “Status” Field).
  8. Click Next.
  9. Choose the destination for the error and success files, then click Finish.
 

C. Relating the Email Message to Contact

 
  1. You would need first to create a new CSV file with the following column headers:
  • Email Message ID (ID can be found on the success file from Data Loader) 
  • RelationId (the RecordId of the sender or recipient)
  • RelationType (it should have value “FromAddress”)
 
  1. Open Data Loader and use the "Insert" function.
  2. Log in with your credentials. Note that you may have to use a Security token for this. Click Next after authentication.
  3. Select the Show all Salesforce objects box and select the object: Email Message Relation (EmailMessageRelation).
  4. Browse for the csv file (the one from step 1) and click Next.
  5. Click OK on the confirmation window indicating the number of records to be processed.
  6. On the next page, click Create or Edit a Map.
  7. On the Mapping screen, click Auto-Match Fields to Columns and click OK (Note do not map the “Status” field).
  8. Click Next.
  9. Choose the destination for the error and success files, then click Finish.
 

D. Show Email Messages on the Activity Timeline

  1. You would need first to create a new CSV file with the following column headers:
  • Email Message ID (this is the ID can be found on the success file from Data Loader)
  • Status (should have the value either 1 (Read) or 3 (Sent))
 
  1. Open Data Loader and use the "Update" function.
  2. Log in with your credentials. Note that you may have to use a Security token for this. Click Next after authentication.
  3. Select the Show all Salesforce objects box and select the object: Email Message (EmailMessage).
  4. Choose the csv file (the one from step 1) and click Next.
  5. Click OK on the confirmation window indicating the number of records to be processed.
  6. On the next page, click Create or Edit a Map.
  7. On the Mapping screen, click Auto-Match Fields to Columns and click OK
  8. Click Next.
  9. Choose the destination for the error and success files, then click Finish.
 
Nummer des Knowledge-Artikels

000380515

 
Laden
Salesforce Help | Article