Skip to main content
Join us at TDX in San Francisco or on Salesforce+ on March 5-6 for the Developer Conference for the AI Agent Era. Register now.

This Badge Requires a New Custom Einstein AI Playground

You’ll have limited time to complete this badge and any other badge requiring a Einstein AI Playground. If you run out of time, you’ll lose access to this Playground and may need to start over.

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). You combine existing data with instructions to create prompt templates. Simply put, a prompt template creates a request, which is sent to an LLM to generate content, which the LLM sends back in a response.

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 frees up time for not one but many sales users. 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 menu
  1. In the Quick Find box, enter einstein setup, then click Einstein Setup.
  2. Turn on Einstein by clicking the toggle. It may already be on if you’ve completed the Quick Start: Agentforce project.
     
    The Einstein Setup page has a toggle to turn on Einstein.
  1. Refresh your browser window to allow new admin settings to show up now that Einstein is enabled.

Enable Einstein for Sales

First you 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.
     
    The Einstein for Sales page has a toggle to enable sales emails.

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’ll be sending using the prompt template.

  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. Open the All Guest Events list view.
  3. Click the GE-00000001 Guest Event.
  4. Click Edit External Reservation to edit the External Reservation field and then select ER-00000004.
  5. Click Save.

Create the Sales Email Prompt Template

Now let's draft the sales email prompt template.

  1. Click Setup and click Setup. (You may need to refresh the page to see Prompt Builder.)
  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.
     
    The New Prompt Template window corresponding to the preceding steps.
  10. Click Next.

Next you need to write clear instructions that describe what is needed from the LLM. The text entered for this prompt specifies 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 Cloud Resorts 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 have a bullet item like this:
     
    - Add a paragraph explaining the characteristics of the reservation, including its Input:Guest_Event__c.External_Reservation__r.Check_in_Date__c, Input:Guest_Event__c.External_Reservation__r.Check_out_Date__c, and Input:Guest_Event__c.External_Reservation__r.Room_Type__c.
     
    Prompt Template workspace corresponding to the preceding steps.
  7. 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.

Resolution

Response

You’re a receptionist for the Coral Cloud Resorts hotel.

Your name is [Your Name], with phone [Provide:

{PHONE}

] and email yourname@example.com.

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: Sofia Rodriguez.

- Add a paragraph explaining the characteristics of the reservation, including its 02/14/2025, 02/19/2025, and Suite.

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

Subject: Welcome to Coral Cloud Resorts, Sofia Rodriguez

Body: Dear Sofia Rodriguez,

Welcome to Coral Cloud Resorts. We are delighted to have you with us.

Your reservation for a Suite is confirmed from 02/14/2025 to 02/19/2025. We trust that you will find your accommodation comfortable and to your liking.

Please note that breakfast is available from 6 to 10 AM. As per your reservation details, breakfast can be included at any time during your stay.

For internet access, please connect to the wifi network 'Coral_Cloud_Guests'. You will be prompted to enter your surname and room number for the password.

Should you have any inquiries or need further assistance during your stay, please do not hesitate to contact us.

Best regards,

[Your Name]

In Prompt Builder, it looks like this:

Prompt Template Workspace with the Activation button highlighted.

  1. Finally, click Activate to activate the prompt template. This is an important step to ensure users can use the prompt template in the org.

Distribute the Sales Email Prompt Template

Next up, verification. 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 and select Contacts.
  2. If you don’t see the standard view, click List View.
  3. Find and click Sofia Rodriguez.
  4. In the Activity section, click Email (the envelope icon).
     
    “”
  5. Click Draft with Einstein.
  6. In the Use pre-made instructions… box, select the Welcome Guest template that you just created.
  7. Select the GE-00000001 guest event and click Continue
  8. After Einstein drafts the email message, 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 help your users create useful content quickly, leaving them more time to focus on other tasks. Use the conversational nature of Einstein to generate content in real-time, and tweak it after it’s created. In this project, you helped Coral Cloud Resorts staff 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 check your work and earn this badge.

Resources

Verify Step

+100 points

You’ll be completing this unit in your own Einstein AI Playground.

This Badge Requires a New Custom Einstein AI Playground

You’ll have limited time to complete this badge and any other badge requiring a Einstein AI Playground. If you run out of time, you’ll lose access to this Playground and may need to start over.

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