Embedded email surveys
An embedded survey puts the first survey question, the 0 to 10 scale, inside an email that Salesforce sends, e.g. when a case is closed. The customer clicks a rating in the email, and the rest of the survey opens in the browser. Because you build the email in Salesforce, it can use case details, e.g. the case subject or the agent's name.
| Example | |
|---|---|
| The email template | |
| The email the customer gets |
How it differs from other surveys
- Salesforce sends the email, not nps.today. A licensed org can send 5,000 emails a day to external addresses, shared with all other single emails from the org.
- It works on cases. A survey is sent when a case gets one of the statuses you choose, to the case's contact.
Before you start
- The current nps.today package is installed and connected, see Install the package. With the old packages, version 1.11 or later is needed.
- A campaign in nps.today and its campaign ID.
- You can edit permission sets, page layouts, email templates and flows.
- The cases have a contact with an email address.
Step 1: Block send outs on the campaign
In nps.today. Edit the campaign and switch on Block send outs. Otherwise nps.today sends its own survey email as well, and customers get two surveys.
Use a campaign of its own
With Block send outs on, nps.today sends no surveys at all on this campaign. Use a campaign only for embedded surveys, not one that flows or buttons also send from.
Step 2: Show the case fields Campaign Id and Email Template Name
The package adds two fields to Case. The flow in step 6 fills them in.
- Go to Setup → Object Manager → Case → Fields & Relationships → Campaign Id.
- Click Set Field-Level Security, tick Visible for the profiles that work with cases, and click Save. You can also give read access to the field in a permission set of your own.
- Do the same for Email Template Name.
Step 3: Give access to the email builder and the survey code
The users who build the email template need two permissions. The nps.today permission sets are part of the package and can't be edited, so give the permissions in a permission set of your own, e.g. NPS Embedded Surveys:
- Go to Setup → Users → Permission Sets, and open your permission set, or click New to create one. Assign it to the users afterwards.
-
System Permissions → Edit: tick Access drag-and-drop content builder and click Save. It gives access to the email template builder.
-
Object Settings → nps.today survey html → Edit: make the tab Available and click Save. The tab holds the HTML code of the survey.
Step 4: Add the case panel to the case page
The NPS P-Gap Closed Case Panel sends the survey when a case is closed. It also holds the settings in step 7.
- Open any case, click the gear icon, and click Edit Page.
- Under Custom - Managed, drag NPS P-Gap Closed Case Panel onto the page.
- Click Save, then Activate.
Only admins and users with nps.today admin see the panel.
Step 5: Create the email template
-
Open the nps.today survey html tab and click the button that copies the survey code.

-
Create a new email template (Lightning). Related Entity Type:
Case. Give it a name you'll remember, e.g.my embed survey. You need the exact name in step 6. - Click Edit in Builder.
- Drag an HTML block into the email and paste the survey code.
- Add the rest of the email, e.g. a greeting and case details with merge fields.
- Click Save.
Step 6: Choose the campaign and template in a flow
A record-triggered flow on Case writes the campaign ID and the template name to the case. You can use different campaigns and templates for different cases.
- Create a Record-Triggered Flow on Case, e.g. when a case is created.
- Add a condition if needed, e.g. Case Origin equals
Email. -
Add an Update Records element that updates the triggering case:
Campaign Id: your campaign ID, e.g.
12048
Email Template Name: the exact name of the template, e.g.my embed survey -
Save and Activate the flow.
Step 7: Switch on the Salesforce email template
On the case panel:
-
Switch on Use Salesforce Email Template.

Warning
If this is off, Salesforce doesn't send the email, and because the campaign blocks send outs, nps.today doesn't either. No survey is sent.
-
Optional: by default, a survey is sent when a case is closed. To send on other statuses, click Customize statuses, move the statuses to the selected list, and click Add selected statuses. At least one status is needed.

Step 8: Test it
- Create a case with a test contact that has your own email address, so the flow fills in Campaign Id and Email Template Name.
- Close the case.
- Check that the email arrives, with the survey in it, and click a rating.
- In nps.today, check that the response is on the campaign.
Send an embedded survey outside of cases
To send an embedded survey from another flow than a case, e.g. after an opportunity is won, call the nps.today embedded survey action from the flow instead of using the case panel. Steps 1, 3 and 5 still apply. Create the email template with the object the flow runs on as its Related Entity Type.
| Input | What to enter |
|---|---|
| Campaign id | The ID of the nps.today campaign |
| Email Template Name | The exact name of the email template with the survey code |
| Recipient | The ID of the lead or contact who gets the survey |
| Related Entity Id | The ID of the record the survey is about, e.g. the opportunity, case or account |
- Pro: works on any record, as long as the flow has the ID of a contact or lead.
- Con: no P-GAP pop-up.
Troubleshooting
| Problem | What to check |
|---|---|
| No email | Use Salesforce Email Template is on (step 7). The case has a contact with an email address. Campaign Id and Email Template Name are filled in on the case. The template name matches exactly. |
| Two survey emails | Block send outs isn't on for the campaign (step 1). |
| The survey links in the email don't work | Update the package, see Packages & versions. |
| No emails after many were sent today | The org's daily limit of 5,000 external emails is reached. |
More is in Troubleshooting.