Skip to main content
Build the future with Agentforce at TDX in San Francisco or on Salesforce+ on March 5–6. 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, limited-time 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.
  4. Make note of your org's expiration date and complete this badge before then.
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 Salesforce AI Trail, you may 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 Setup 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: Agentforce 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 Setup 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 Setup and click Setup.
  2. Select the Object Manager tab.
  3. In the quick find box, enter Guest Event and then click Guest Event.
  4. Click Fields & Relationships.
  5. Click New.
  6. Select Lookup Relationship then click Next.
  7. For Related To, select External Reservation.
  8. Click Next, Next, 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 later 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 the GE-00000001 Guest Event.
  3. Click Edit External Reservation and then select ER-00000004.
  4. Click Save.

Create the Sales Email Prompt Template

Now let's draft the sales email prompt template.

  1. Click Setup and click Setup.
  2. In the quick find box, enter prompt, then click Prompt Builder.
  3. Click New Prompt Template.
  4. For Prompt Template Type, select Sales Email.
  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, make sure Contact is selected.
  9. For Related Object, enter guest in the Related Object search box, then select Guest Event.
    New Prompt Template builder
  10. Click Next.

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, in the bullet list, delete the placeholder for the check-in date field, Check_in_Date__c, and leave the cursor in that position.
  2. In the Resource field, enter guest and then select Guest Event > External Reservation > Check-In Date.
  3. Delete the placeholder for the check-out date field, Check_out_Date__c, and leave the cursor in that position.
  4. In the Resource field, enter guest and then select Guest Event > External Reservation > Check-Out Date.
  5. Delete the placeholder for the room type field, Room_Type__c, and leave the cursor in that position.
  6. In the Resource field, enter guest and then select Guest Event > External Reservation > Room Type.
    Your template should look like this.

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 template.

  1. In the Preview area, for Recipient, enter Sofia and then select Sofia Rodriguez.
  2. For Related Record, enter GE and then select GE-00000001.
  3. Click Preview.
  4. After the preview is generated, review the Resolution and the Response.
  5. Now click Activate to activate the prompt template. This is an important step to ensure users can use the prompt template in the org.

Prompt Template Workspace with the Activation button highlighted.

Distribute the Sales Email Prompt Template

Next up, testing. Let’s say Sofia Rodriguez has just checked in and should receive a Welcome Guest email.

  1. Click App Launcher, and enter Contacts into the quick find box. Select Contacts. If you don’t see the standard view, click List View.
  2. Find and click Sofia Rodriguez.
  3. In the Activity section, click Email (the envelope icon).
    The contact record for Sofia Rodriguez.
  4. Click Draft with Einstein.
  5. In the Use pre-made instructions… box, select the Welcome Guest template that you just created.
  6. Select the guest event GE-00000001 and click Continue
  7. Click Done and then 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