Appearance
Exercise 3: Create a Sales Email Template
In this exercise, you'll use a Sales Email template to generate personalized emails welcoming guests for their upcoming trip. You'll use a flow to ground the template in Coral Cloud Resorts' customer data.
Step 1: Enable Sales Email templates
In Setup, search for Einstein for Sales in Quick Find and select Einstein for Sales.
Enable Sales Email Prompt Templates by setting Turn on Sales Emails to True.
Enable Customization by setting Add Email Prompt Instructions to True.
Step 2: Create a flow that grounds a prompt in customer data
In this step, you'll create the flow that will be used to ground the email prompt template with a list of resort experiences that match a guest's interests.
In Setup, search for Flow in Quick Find and select Flows.
Click New Flow.
Leave Start from Scratch selected and click Next.
Select Template-Triggered Prompt Flow and click Create.
In the right panel, select Automatic Inputs and configure the Start element as follows:
Field Value Prompt Template Type Sales Email Template Capability Recipient Contact Related Object <Leave empty>
Get the experiences that match the guest's interests:
Mouse over the circle under the Start element, click +, and select Get Records.
In the right panel, configure the Get Records action as follows:
Field Value Label Get Experiences API Name Keep default Description Get a list of resort experiences that match the guest's interests Data Source Salesforce Object Object Experience Condition Requirements Any Condition is Met (OR) Define the three conditions below:
Field Operator Value Type__c Equals $Input > Recipient > Interest 1 Type__c Equals $Input > Recipient > Interest 2 Type__c Equals $Input > Recipient > Interest 3 Under How Many Records to Store, select All Records.
Use the screenshot below to confirm you entered all the values correctly.
Add each matching experience to the prompt:
Mouse over the circle under the Get Experiences element, click +, and select Loop.
In the right panel, define the loop element as follows:
Field Value Label Experiences Loop API Name Keep default Description Loop through experiences Collection Variable Experiences from Get_Experiences Use the screenshot below to confirm you entered the right values.
Mouse over the circle inside the For Each element, click +, and select Add Prompt Instructions.
In the right panel, define the Add Prompt Instructions element as follows:
Field Value Label Add Experience to Prompt API Name Keep default Description Add each experience matching guest's interests to the prompt Prompt Instructions(Resource Picker) Current Item from Loop Experiences_Loop > Name Use the screenshot below to confirm you entered the right values.
To save and activate the flow:
Click Save and configure the flow as follows:
Field Value Flow Label Add Experiences to Prompt Flow API Name Keep default Description Add experiences that match the guest's interests to the prompt Click Save.
Click Activate.
Your flow should look like this:
Step 2: Create the Sales Email template
In Setup, search for Prompt Builder, and select Prompt Builder.
Click the New Prompt Template button.
Configure the prompt template as follows:
Parameter Value Prompt Template Type Sales Email Prompt Template Name Welcome Email for Upcoming Trip API Name Keep default Template Description This template is used to generate a welcome email for a guest's upcoming trip. Recipient Contact Related Object Leave blank Click Next.
Paste the following text in the Prompt Template Workspace:
txtYour name is SENDER_NAME. You work in the guest success team at ORGANIZATION_NAME, a luxury beachfront resort. Generate an email welcoming the guest for their upcoming stay. Guest name: GUEST_NAME. Check-in date: NEXT_CHECK_IN_DATE. Write a story that paints the picture of infinite possibilities at the resort and that weaves in some of the resort experiences that match the guest's interests. List of resort experiences matching the guest's interests: EXPERIENCES.
Replace the placeholders below with the corresponding merge fields (click the Resource search box to access merge fields).
Placeholder Merge field SENDER_NAME Sender > Full Name ORGANIZATION_NAME Current Organization > Name GUEST_NAME Recipient > Full Name NEXT_CHECK_IN_DATE Recipient > Next Check-in Date EXPERIENCES Flow > Add Experiences to Prompt In this first version of the prompt, you use a manually submitted check-in date stored on the Contact record. This is not ideal as the data might get outdated. You'll revisit this template in a later exercise to dynamically retrieve the check-in date from Data Cloud Reservations.
In the Preview panel, select Sofia Rodriguez as the Recipient.
Click Save & Preview.
In the Resolution panel, examine the prompt that was generated. Notice that the flow merge field in the template has been replaced with the list of experiences that match the guest's interests generated by the flow.
In the Response panel, examine the email generated by the LLM.
Click Activate when you are satisfied with your template.
Step 3: Generate emails
In the Coral Cloud Resorts app, click the Contacts tab.
Open Sofia Rodriguez.
Click the Activity tab.
Click Email.
Click Draft with Einstein.
Click Start with pre-made instructions.
Select the Welcome Email for Upcoming Trip template, and watch Einstein draft the email.
Expand the email window.