To import email templates from data loader we need to follow steps mentioned below:
Following fields are required in your file:
- Prepare csv file to upload for email templates
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.
- Folder ID - the ID of the specific folder that you wished to add the template to save into
- 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.
- API Version - Can be left blank if not known.
- Available For Use - whether it is active or not, when you tick the checkbox named "Available For Use"
- Created By ID - 18 digit ID of user who you want to update for this record as created by.
- Created Date - created date in format MM/DD/YYYYTHH:MM:SS.000Z
- 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.
- Email Body - A template text which will be copied to your email body
- Email Template Name - Required field .
- Encoding - drop down list
- HTML Value - HTML code of Email Template if type is Visualforce.
- Owner ID - record owner ID
- Style - If you are not sure you can write "none".
- Subject - It is required field.
- Template Type - Text, Visualforce, HTML (using Letterhead), Custom (without using Letterhead). Type name of template type .
- 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.
- Times Used
- Enter your Salesforce username and password with security token. Click Log in to log in. After your login completes successfully, click Next.
- Insert function: Open Data Loader in your desktop and click on “Insert” function button.
- 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
- Click Next. After the object and CSV file are initialized, click OK
- Mapping Fields: Here is the tricky part, use the Mapping Dialog window to associate Salesforce fields with the columns of your CSV file.
- 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.
- 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.
- 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.
- Click OK to use your mapping for the current operation.
- Click Next.
- 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.
- Click Finish to perform the operation, and then click Yes to confirm.
- As the operation proceeds, a progress information window reports the status of the data movement.
- 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"