Skip to main content
Join Trailblazers for Dreamforce 2024 in San Francisco or on Salesforce+ from September 17-19. Register now

Get Started with Sales Email Prompt Templates

Learning Objectives

In this project, you’ll:

  • Create a draft sales email using Prompt Builder.
  • Distribute the Sales Email Prompt Template.

Speed Up Your Workflows

Prompt Builder gives organizations an easy way to tap into the power of generative AI. A prompt template is a reusable prompt that keeps data secure while communicating with a large language model (LLM). It helps combine existing data with instructions to create prompt templates. Simply put, prompt templates are used to create messages that are then sent to the LLM to generate content.

In this project, you create a sales email prompt template that can be used throughout an org. You also create an Einstein sales email using the new prompt template. This sales email prompt template not only frees up time for sales users, but is also scalable. Templates can be reused for different products and customers because the LLM writes the emails and enables the email workflows to run efficiently. For a more in-depth explanation of prompts and prompt templates, check out Prompt Fundamentals.

Sign Up for a Custom Playground with Einstein AI

To complete this project, you need a special, 14-day custom playground that contains Einstein AI and our sample data.

  1. If you haven't already, click the I can receive a password email checkbox in the beginning of the unit.
  2. Click Create Playground.
  3. Follow the prompts.
Note

This Developer Edition is designed to work with the challenges in this badge, and may not work for other badges. Always check that you’re using the Trailhead Playground or special Developer Edition org that we recommend. 

If you’re working on the Drive Productivity with Einstein AI Trail, you’ll also use this org for these Trailhead projects:

Enable Einstein Setup

The first thing you need to do is enable Einstein Setup in the org.

  1. If you don’t already have your Einstein AI-enabled org open, scroll down to the Challenge section and click Launch to open it. Be sure the new demo org you created is listed before clicking Launch.
  2. Click gear icon and click Setup. The Setup page opens in a new tab.

Setup dropdown menu

  1. In the Quick Find box, enter einstein setup, then click Einstein Setup.
  2. Turn on Einstein by clicking the toggle. It may be on already if you’ve completed the Quick Start: Einstein Copilot project.

Einstein Setup toggle button

  1. Refresh your browser window to allow new admin settings to show up now that Einstein is enabled.

Enable Einstein for Sales

We first need to turn on Einstein for Sales.

  1. Click gear icon and click Setup.
  2. In the quick find box, enter Einstein for Sales, then click Einstein for Sales.
  3. Turn on Sales Emails by clicking the toggle.
    Einstein for Sales Email toggle button.

Create A Connection Between A Guest Event And Reservation

Before drafting the Sales Email Prompt Template, you need to create a lookup field on a guest event that will look up a reservation. This will help pull all the related fields of the guest reservation into the email you will be sending using the prompt template next.

  1. If you are not already in setup, click gear icon and click Setup.
  2. Select the object manager tab.
  3. In the quick find box, enter Guest Event then click Guest Event.
  4. Click Fields & Relationships.
  5. Click New.
  6. Select Lookup Relationship then click Next.
  7. Select External Reservation from the dropdown menu.
  8. Click Next, Next, and Save.

Now that we can associate a reservation with a guest event, let’s create a new external reservation.

  1. From the Sales Home Page, Click the External Reservations tab.
  2. Click New.
  3. Select today’s date for the Check-in Date then 5 days out for the Check-out Date.
  4. Enter Suite for the Room Type.
  5. Click Save.

Next, associate the External Reservation with a Guest Event.

  1. Click the Guest Events tab.
  2. Click on GE-00000001 Guest Event.
  3. Click pencil icon and select ER-00000004 External Reservation from the dropdown menu.
  4. Click Save.

Create the Sales Email Prompt Template

Now let's draft the sales email prompt template.

  1. Click gear icon and click Setup.
  2. In the quick find box, enter prompt, then click Prompt Builder.
  3. Click New Prompt Template. For this example you use the Sales Email type of prompt template so select Sales Email from the Prompt Template Type dropdown list.
  4. Prompt Template Type dropdown menu
  5. For Prompt Template Name, enter Welcome Guest.
  6. For the API Name, enter Welcome_Guest if it doesn’t automatically populate for you.
  7. For Template Description, enter This template is used to craft a welcome email for guests, sent once they check in.
  8. For the recipient, find and select Contact from the Recipient dropdown.
  9. For Related Object, enter guest in the Related Object search box, then select Guest Event.
  10. Click Next.

New Prompt Template builder

Next you need to write clear instructions that describe what is needed from the LLM. The text entered for this prompt needs to specify the tone of voice, the sender, the contact information of the sender, and specific details for the body of the email. Keep in mind that writing prompts is a skill. Much like any other skill, practice makes perfect.

Let’s add our prompt text.

  1. Copy and paste the following text to your template:
You’re a receptionist for the Coral Clouds Resort hotel.
Your name is {!$Input:Sender.Name}, with phone {!$Input:Sender.Phone} and email {!$Input:Sender.Email}.
A guest has just checked-in, and you want to send them a welcome email.


Instructions:


'''
Use clear, concise, and straightforward language using the active voice and strictly avoiding the use of filler words and phrases and redundant language.
Generate a subject line that can increase open rate using words and content that is related to the email body content.
Generate the body of the email, which will have the next format:


- First add a title that includes the name of the guest and welcomes them: {!$Input:Recipient.Name}.
- Add a paragraph explaining the characteristics of the reservation, including its Check_in_Date__c, Check_out_Date__c, and Room_Type__c.
- Explain breakfast is available from 6 to 10 AM. Find in the reservation if it's included and add this information to the email, mentioning it can be included any time.
- Add the wifi network: Coral_Cloud_Guests. Mention for password, guests will be prompted for their surname and room number.
- End the email by encouraging the guest to contact you if they have any inquiries.
'''


Now generate the welcome email to your guest.
  1. For Models, select OpenAI GPT 4.

Next, we need to add the merge fields we created a few minutes ago.

  1. Within the Prompt Template Workspace, click next to Guest Event.
  2. Select Guest Event from the Resource dropdown.
  3. Select External Reservation then select Check-In Date.
  4. Remove the Check_In_Date__c text if it’s still present in the template.
  5. Repeat steps 1-4 for both Check_Out_Date__c and Room_Type__c.

Prompt Template workspace with prompt entered

  1. Click Save.
Note

Notice how the template uses merge fields to reference data from the contact, the sender (User), and external reservations. While contact and user data live in the Salesforce CRM, reservations is a related list that was exposed in the CRM using Data Cloud enrichment.

Next, preview and activate the prompt.

  1. In the Preview area, for Recipient, enter Sofia in the search bar, and select the contact, Sofia Rodriguez.
  2. For Related Record, enter GE and select the guest event GE-00000001.
  3. Click Preview. Once your preview has been generated review the Resolution and Response fields.
  4. Now click Activate the prompt template. This is an important step to ensure users can call the prompt template in the org.

Prompt Template Workspace with the Activation button highlighted.

Did you notice when in preview that the name at the bottom of the email is org farm? That is just pulling from your username record. If you want to update, just adjust in your user record settings.

Distribute the Sales Email Prompt Template

Next up, testing. Let’s say Sofia Rodriguez has just checked in and a Welcome Guest email needs to be sent to her.

  • Click App Launcher icon, and enter Contacts into the quick find box. Select Contacts. If you do not see the standard view and are instead viewing the intelligence view, click List View.
  • Find and click Sofia Rodriguez.
  • Click the Activity tab.
  • From the Activity section, click the Email icon.

Sofia Rodriguez Contact Record open with the Activity tab and email tab highlighted.

  • Click Draft with Einstein.
  • In the Use pre-made instructions…box, select the Welcome Guest template that you just created.
  • Select the guest event GE-00000001 and click Continue
  • Click Done and click Send. A welcome email will be sent to Sofia.

Sending an email using the Draft with Einstein Sales Email Prompt Template listed.

With Einstein Generative AI you can quickly create useful content, leaving more time for users to focus on other tasks. You can use the conversational nature of Einstein to help refine generated content in real-time, and tweak it after it’s created. In this case, Coral Cloud Resort can quickly and easily send a specialized welcome email to guests who have just checked in.

Verify Your Work

You’re now ready to see how the combined power of data and AI can help you create specialized welcome emails. Click Verify step in the Challenge section to earn 100 points.

Resources

Share your Trailhead feedback over on Salesforce Help.

We'd love to hear about your experience with Trailhead - you can now access the new feedback form anytime from the Salesforce Help site.

Learn More Continue to Share Feedback