Loading
Upcoming Mandatory Changes to Public Key Infrastructure (PKI)Read More
Salesforce Enforces New Security Requirements in Summer 2026Read More
Agentforce and Einstein Generative AI
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Add Record Merge Fields to a Sales Email Prompt Template

          Add Record Merge Fields to a Sales Email Prompt Template

          Merge fields are critical to scaling a sales email prompt template for multiple customers and products. They connect your prompt templates to Salesforce record fields, such as from sales or service records. In a prompt template, a merge field acts like a placeholder. After you run the template, the LLM replaces the merge field with your actual data.

          Required Editions

          Available in: Lightning Experience
          Available in: Enterprise, Performance, and Unlimited Editions with the Einstein for Platform, or Einstein or Agentforce for Sales or Service add-on, or Agentforce Foundations
          User Permissions Needed
          To create and manage prompt templates in Prompt Builder:

          Prompt Template Manager permission set

          • Manage Prompt Templates
          • Execute Prompt Templates

          OR

          Customize Application permission set

          To add a merge field to a prompt template in Prompt Builder, click the Insert Resource selector and select a resource from the dropdown menu of placeholder values for your CRM data.

          Let’s look at a sales email prompt template that uses merge fields. Say you sales team spends a significant amount of time writing introduction emails from scratch for leads or contacts.

          Using an LLM to write these descriptions is more efficient, and the LLM can use your up-to-the-minute data to create content. To get started, create a prompt template. 

          1. In the Prompt Template Type dropdown, select Sales Email.
          2. For the Prompt Template Name, enter Draft an Introduction Email.
          3. For the Recipient Type, select Contact.
          4. Leave the Template Description and Object fields empty.
          5. Click Next.
          6. In the Example Prompt Template Library, find the sales email prompt template titled: Draft an introduction email for a new lead or contact. Copy and paste this template into the Prompt Template Workspace.
          7. This example contains placeholder text for prompt template resources. Before you can run this template in Prompt Builder, in the Prompt section, click Insert Resource. The search field appears the first time you click this option.
          8. Use the search bar to replace the placeholders with real merge fields. When the template is resolved into a prompt, the merge fields are replaced with the real email sender’s name and the recipient’s name and company.
          9. To run the prompt template and see the LLM-generated email draft:
            1. Click the Preview Settings button.
            2. Under Inputs, enter a contact name in the Recipient search bar and select it. This selection defines the recipient of the LLM-generated email draft.
            3. In the Configure Response and Display sections, verify that Generate Response, Display Prompt, and Display Resolution are selected or deselected based on what you want to test.
            4. Click Save & Preview, and review the resolved prompt and the response.
           
          Loading
          Salesforce Help | Article