Print this page

Import Email Templates from Data Loader

Knowledge Article Number 000231318
Description Import Email Templates from Data Loader

 Available in: both Salesforce Classic and Lightning Experience
 Available in: • Enterprise
                     • Performance
                     • Unlimited
                     • Developer
 User Permissions: "Create" on the record.
 Description: This article will help you in step-wise process to import email templates using Apex Data Loader tool.
To import email templates from data loader we need to follow steps mentioned below:
  1. Prepare csv file to upload for email templates
      Following fields are required in your file:
  1. Folder ID - the ID of the specific folder that you wished to add the template to save into
  2. Letterhead ID -  If template type is letterhead then the use the 15 digit ID of letterhead, you can find in the end of url of letterhead detail page. Its optional.
  3. API Version - Can be left blank if not known.
  4. Available For Use - whether it is active or not, when you tick the checkbox named "Available For Use
  5. Created By ID - 18 digit ID of user who you want to update for this record as created by.
  6. Created Date - created date in format MM/DD/YYYYTHH:MM:SS.000Z
  7. Description - Note that the Description field is for internal use only. It will be listed as the title of any email activities you log when sending mass email. 
  8. Email Body - A template text which will be copied to your email body
  9. Email Template Name - Required field . 
  10. Encoding - drop down list
  11. HTML Value - HTML code of Email Template if type is Visualforce. 
  12. Owner ID - record owner ID
  13. Style - If you are not sure you can write "none". 
  14. Subject - It is required field. 
  15. Template Type - Text, Visualforce, HTML (using Letterhead), Custom (without using Letterhead). Type name of template type . 
  16. Template Unique Name - It is required field. The unique name used by the API and managed packages. The name must begin with a letter and use only alphanumeric characters and underscores. The name cannot end with an underscore or have two consecutive underscores. usually same as Email Template Name.
  17. Times Used
Note: You can get the FolderID and OwnerID/ Letterhead ID by running a report in Salesforce and adding the ID of the record as a report column. Or you can go to the detail page and copy the 15 digit ID provided in URL.
  1. Enter your Salesforce username and password with security token. Click Log in to log in. After your login completes successfully, click Next. 
  2. Insert function:  Open Data Loader in your desktop and click on “Insert” function button.
  3. Choose Object/Table: A user should choose the Email Templates (EmailTemplates) table on Data Loader and use the Insert function. And upload the csv file you prepared with required fields and data. Click on Browse and choose a location where it was saved and choose the file 
  4. Click Next. After the object and CSV file are initialized, click OK
  5. Mapping Fields: Here is the tricky part, use the Mapping Dialog window to associate Salesforce fields with the columns of your CSV file.
    1. To automatically match fields with columns, click Auto-Match Fields to Columns. The Data Loader populates the list at the bottom of the window based on the similarity of field and column names. For a delete operation, automatic matching works only on the ID field.
    2. To manually match fields with columns, click and drag fields from the list of Salesforce fields at the top to the list of CSV column header names at the bottom. For example, if you are inserting new Account records where your CSV file contains the names of new accounts, click and drag the Name field to the right of the NAME column header field.
    3. Optionally, click Save Mapping to save this mapping for future use. Specify a name for the SDL mapping file. If you select an existing file, the contents of that file are replaced. Click Yes to confirm this action, or click No to choose another file.
    4. Click OK to use your mapping for the current operation.
  6. Click Next.
  7. For every operation, the Data Loader generates two unique CSV log files; one file name starts with “success,” while the other starts with “error.” Click Browse... to specify a directory for these files.
  8. Click Finish to perform the operation, and then click Yes to confirm.
  9. As the operation proceeds, a progress information window reports the status of the data movement.
  10. After the operation completes, a confirmation window summarizes your results. Click View Successes to view your success file, click View Errors to open your errors file, or click OK to close.
NOTE: Please note that if you cannot see the EmailTemplates object when choosing the insert option, make sure that you have selected the checkbox "Show all objects"

promote demote