Send Email using Salesforce Email Templates

  • Updated

This article outlines the process to allow a decision tree integrated with a Salesforce record to use your Salesforce Email Templates. These emails are sent via Salesforce rather than a Zingtree email node.

The user can click a button within the tree that will display the available email templates. Once a template is chosen, the user can choose the From Email Address and process the email. 

 

Requirements

  • Zingtree embedded in a Salesforce Case record. Please see this article to set up the Zingtree integration in your Salesforce environment. The case will need the Contact's Email address already saved in order for the templates to send.
  • Email-to-case set up in your Salesforce environment.
  • An Email Template folder in Salesforce that contains the templates you would like this tree to use. The folder and templates can be created in either Classic or Lightning. In either case, we will need the API name of the folder. This is also known as the Folder Unique Name.

Setup Salesforce Email Templates for use with Zingtree

  1. Create an email template folder that contains all of the templates that you would like Zingtree to choose from. You can create the folder in either Classic or Lightning.
  2. Make note of the API name or Folder Unique Name. If you created the folder in Lightening, you'll need the Folder Unique Name. If you created the folder in Lightening, you'll need the folder API name.

Setup your Tree

  1. In the Zingtree editor, open the tree that you want to display your Salesforce Email Templates.
  2. Navigate to Settings > Code tab.
  3. Enter the following code, then Save:
    <script>
    function showEmailTemplates(param) {
    window.parent.postMessage('sf_ShowEmailTemplates-'+ param, '*');
    }
    </script>
  4. In the Zingtree editor, add/edit the Content Node where you would like to have Zingtree choose from your Salesforce Email Templates and send an email.
  5. Enable Code View in the Content Node Editor by clicking here:
  6. Paste this code where you would like the button to appear:
    <a class="btn btn-primary" onclick="showEmailTemplates('sf_f_EmailTemplatesforZingtree');" style="cursor:pointer;">Choose an email template</a>
  7. Replace this section of the code with the name of your Email Template Folder as it is named in Salesforce. This must be the folder's API name or Folder Unique Name. This cannot be the main default folder. Create a folder that contains all of the templates that you would like Zingtree to choose from. If you created the folder in Lightening, you'll copy the Folder Unique Name. If you created the folder in Lightening, you'll copy the folder API name.
  8. Optionally, you can replace the text of "Choose an email template" with the text of your liking. This will be the text that displays on the button.
  9. Copy your Tree ID so that you can now embed this tree in your Salesforce environment on a Case Object page layout. This step assumes that you've already configured your Zingtree/Salesforce integration.

 

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request

Didn't find what you need?

Our friendly customer support team is here to help

Submit a Ticket

Looking for help or advice?

Reach out to our knowledgeable community of users.

Zingtree Community