Setting Up the Email Template for Automated Surveys in AskNicely
This guide walks you through the process of setting up an email template to ensure the correct fields are passed into AskNicely from Salesforce.
Step 1: Create a Classic Email Template
- Navigate to the Salesforce Setup Screen.
- Search for Classic Email Templates and select it.
- Click Create New Template.
- Name the template Opportunity Survey Trigger.
- Ensure you check the box Available for Use to make it accessible in later steps.
Step 2: Define Field Names and Merge Fields
The email template will act as an API document by specifying:
- A field name
- A colon separator (
:
) - A field value (merge field)
To retrieve merge fields:
- Select the Opportunity Fields section.
- Locate the relevant fields such as Primary Opportunity Contact and Primary Opportunity Contact Email.
- Copy the merge field values and paste them into the email template.
Step 3: Add Required Fields
Include the following essential fields:
- name: Contact’s full name
- email: Contact’s email address
- sfaccountid: Salesforce Account ID
- sfopportunityid: Salesforce Opportunity ID (custom field to follow API naming conventions)
- opportunityname: The name of the opportunity
- surveytemplate: Specifies which survey template should be used
Step 4: Customizing Your Email Template
The email template can be customized further by adding additional arguments:
- delayminutes: Delays survey delivery by a specified number of minutes
- triggeremail: Set to
true
to override contact rules and ensure the survey is sent
These optional arguments provide flexibility for survey distribution, including delays and rule overrides.
Summary
Once your email template is properly configured, it becomes the foundation for triggering surveys from Salesforce to AskNicely. Ensuring correct merge fields and API field names is critical for accurate data mapping.
Next Steps
In the next guide, we’ll cover how to link this email template to the automation flow for triggering surveys.