Simplesat allows you to create a CSAT or NPS survey that you can embed directly in Salesforce email notifications.

In this article:

Create your survey

First, create a new survey.

Customize the survey settings, then choose the Integrate with another tool option in the Publish section and select Generic Embed in the pop-up box.

Enter Salesforce's placeholders into the fields:

Salesforce Classic email placeholders:

  • Team Member Email - {!relatedTo.Owner.Email}

  • Team Member ID - {!relatedTo.Owner.Id}

  • Team Member First Name - {!relatedTo.Owner.FirstName}

  • Team Member Last Name - {!relatedTo.Owner.LastName}

  • Customer Email - {!relatedTo.Contact.Email}

  • Customer ID - {!relatedTo.Contact.Id}

  • Customer First Name - {!relatedTo.Contact.FirstName}

  • Customer Last Name - {!relatedTo.Contact.LastName}

  • Company Name - {!relatedTo.Account.Name}

  • Ticket ID - {!relatedTo.Id}

  • Ticket Subject - {!relatedTo.Subject}

Note: The placeholders listed above are for Visualforce Email Templates in Salesforce Classic.

Salesforce Lightning email placeholders:

  • Team Member Email - {{{Sender.Email}}}

  • Team Member ID - {{{Sender.ContactId}}}

  • Team Member First Name - {{{Sender.FirstName}}}

  • Team Member Last Name - {{{Sender.LastName}}}

  • Customer Email - {!relatedTo.Contact.Email}

  • Customer ID - {{{Recipient.Id}}}

  • Customer First Name - {{{Recipient.FirstName}}}

  • Customer Last Name - {{{Recipient.LastName}}}

  • Company Name - {{{Recipient.Company}}}

  • Ticket ID - {{{Case.Id}}}

  • Ticket Subject - {{{Case.Subject}}}

Note: You can check the available merge fields by clicking the merge field picker icon.

Once you have the placeholders filled in, click Generate Embed Code. Make sure you're on the HTML option, then click Copy survey.

Add your survey to Salesforce Classic

In your Salesforce account, click on Setup then type Classic Email on the Quick Find/Search

Click on Classic Email Templates > New Template > Visualforce

Select the appropriate folder and enter the name. description and subject line for the email template then click on Next

For the email content, change the messaging:plainTextEmailBody to messaging:htmlEmailBody for both the opening tag and the closing tag. Your empty template should now look like this:


Now we are ready to paste in the HTML survey embed and add whatever other content is appropriate for your notification email.

If you're getting this error when trying to save the notification template:

You need to add the </img> end tag on every section that contains the <img> as, by default, the survey embed code doesn't contain this tag.

If you're getting this error when trying to save the notification template:

You need to add relatedToType="Case"> on the first line for the survey email template that will be associated with a case.

Add your survey to Salesforce Lightning

In your Salesforce account, click on App Launcher then type Email on the Search apps and items engine.

Click on Email Templates > New Template

  • Enter the template’s name.

  • Add a subject. To include merge fields, type them in manually.

  • If you want, select an item from the Related Entity Type dropdown list.

    Based on the selection, the email template can be chosen only when the email you’re composing has a corresponding Related To record.

Learn more about creating an email template in Salesforce Lightning from here.

In the email template, click the section where you want to add the survey. Next, change it over to source code by clicking the source code icon. Then, paste the HTML survey code that you copied.

You can switch back by clicking the source icon again to preview the visual email. Then, click Save.

If you're getting this error when trying to save the notification email template:

You need to disable your Grammarly extension to save the template. You can learn more about this here.

If you're getting this error when trying to save the notification template:

You need to switch to a non-Console app and create the template from there. Once the email template is created, you will be able to make changes to it from the Console app.

This is a known issue with Salesforce Lightning template. You can learn more about this here.

Try it out!

Create a test ticket with yourself as the requester. Check your email and click any rating that you like. Once you do, new feedback should instantly show up in your Simplesat dashboard. 🎊

If you run into any issues let us know and we'll be happy to help troubleshoot. 🙌

Did this answer your question?