---
schema_version: "1"
id: e688c60bd3870bce9c82d13d44c663b3a93a863276b14d346f1fc76860d6003b
title: Add Record Merge Fields to a Sales Email Prompt Template
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ai/264-0-0/prompt_builder_add_merge_fields_sales_email.md
canonical_url: https://help.salesforce.com/s/articleView?id=ai.prompt_builder_add_merge_fields_sales_email.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 133e5058bbafe9a0afd36035903ff6fb4a41493717446f4fbd896abf11ac623f
description: 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.
products:
  - Agentforce
  - Cross Cloud
release: "264"
---
# 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

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Enterprise</strong>, <strong>Performance</strong>, and <strong>Unlimited</strong> Editions with the Einstein for Platform, or Einstein or Agentforce for Sales or Service add-on, or Agentforce Foundations</td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d190799e63">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d190799e63 ">To create and manage prompt templates in Prompt Builder:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d190799e63 ">
              <p>Prompt Template Manager permission set</p>
              <ul>
                <li>Manage Prompt Templates</li>

                <li>Execute Prompt Templates</li>

              </ul>
              <p>OR</p>
              <p style="margin-bottom:0;">Customize Application permission set</p>
            </td>

          </tr>
        </tbody>
      </table>

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](https://help.salesforce.com/s/articleView?id=ai.prompt_builder_example_library.htm&release=264.0.0&type=5 "This library of example prompt templates gives you a starting point for creating your own custom prompt templates."), 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.