Skip to main content
Build the future with Agentforce at TDX in San Francisco or on Salesforce+ on March 5–6. Register now.
예상 시간
주제
커뮤니티에 질문하기

Add Data to a Prompt Template to Quickly Draft Emails

Create and Use a Sales Email Prompt Template

Coral Cloud goes to great lengths to give its guests a fantastic vacationing experience that feels perfectly tailored to their interests. That level of personalization takes a lot of effort. One example is the welcome email that every guest receives upon check-in. It includes more than just the WiFi password. Staff at the front desk often add small details from the conversations they have during check-in. This time-consuming task is about to get a lot easier thanks to Prompt Builder.

As you learn in the Prompt Builder Basics badge, the key to scalable generative AI is to use prompt templates to tell a large language model (LLM) how it should generate content. Prompt templates merge specific data, such as reservation details, with general instructions to make a unique prompt each time the template is called. There’s an art to creating prompt templates, which you can learn about in the Prompt Fundamentals badge. And if you want to know more about LLMs in general, check out the Large Language Models badge.

Becca wants to create a prompt template for drafting welcome emails. She wants to include details about the most recent reservation and allow front desk staff to quickly add personal touches to the generated messages. She starts by navigating to Prompt Builder in Setup.

  1. Click the Setup iconSetup icon , then click Setup.
  2. Type prompt in search, then click Prompt Builder.
  3. Click New Prompt Template.
  4. For Prompt Template Type, choose Sales Email.
  5. For Prompt Template Name, enter Check-in Welcome.
  6. For Description, type Check-in welcome email.
  7. For Related Object, choose Guest Event.

Prompt template creation dialog with all fields complete.

  1. Click Next.
    For the sake of time, instead of writing a prompt from scratch, let’s just use the one Becca has been working on.
  2. Paste the following into the Prompt Template Workspace.
    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 described in {!$Input:Guest_Event__c.Details__c}, including its check in date, check out date, and room type.
    - 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 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.
  3. Click Save.
  4. Click Activate.

Notice that Becca’s prompt includes multiple merge fields, which are colored blue. One field, Guest_Event__c.Details__c, contains data that originated from Reserv-o-matic. Nice for it to make an appearance!

Test Your Work

The final step for any good admin is to test their work, and that’s exactly what Becca does next.

  1. Close the Setup tab to return to the Sales app.
  2. Click the Contacts tab.
  3. Click Sofia Rodriguez.
  4. Click the Email icon.

Activities panel with email icon highlighted.

  1. Click Draft with Einstein Draft with Einstein button..
  2. Click Use pre-made instructions, then choose Check-in Welcome.

Mail panel with pre-made instructions menu open.

  1. For Guest Event, choose the GE record created in the previous section.
  2. Click Continue.
    At this point Einstein is writing the welcome email based on the new prompt template, and in a moment the draft will appear. Front desk staff can review the results, and add in any personal touches they’d like.
  3. Click Done.
  4. Click Send.

And there you have it. In just a few clicks, a personalized and informative welcome email is on its way to another happy guest. Becca is quite satisfied with the way her project combined Data Cloud, Agentforce, and Prompt Builder to improve the experience of guests and staff alike. And after a short moment of reflecting on the success of the project, Becca sets out to find the social coordinator to begin their next AI + Data adventure.

Salesforce 도움말에서 Trailhead 피드백을 공유하세요.

Trailhead에 관한 여러분의 의견에 귀 기울이겠습니다. 이제 Salesforce 도움말 사이트에서 언제든지 새로운 피드백 양식을 작성할 수 있습니다.

자세히 알아보기 의견 공유하기