Sub topic 5
Sales Email templates
Prerequisites
This chapter assumes you know Salesforce objects, records, fields and relationships. You should be comfortable in Lightning Experience and Setup. You should also know the basics of prompts and generative AI. Einstein generative AI must be enabled in your org, because Prompt Builder depends on it. The earlier chapters covered template anatomy and grounding. This chapter applies both to the Sales Email type.
What a Sales Email template is
A Sales Email template is a prompt template that drafts an email for a sales rep. It is one of the object-bound template types. The template is tied to specific records, so when someone uses it, Salesforce fills the prompt with real data from those records.
The main inputs are a recipient and a related record. The recipient is a Contact or a Lead. The related record is usually an Account, an Opportunity, or similar context. The output is a draft that appears in the email composer, where the rep reads it, edits it and sends it. The model does not send anything. A human reviews every draft.
Use this type when:
- The output is an email addressed to one person.
- The email depends on facts stored in Salesforce, such as the recipient's name, company or open deals.
- You want reps to start from a consistent, on-brand draft instead of a blank page.
How a Sales Email template is built
A Sales Email template has the same parts as any template: a name, a type, a model, the prompt text, and grounding. In Prompt Builder you create the template, choose the Sales Email type, and write the prompt in the editor. You then insert merge fields and resources that pull data into the prompt.
Merge fields
A merge field is a placeholder that Salesforce replaces with a value from a record. In a Sales Email template, the recipient is available through the input name. The syntax looks like this:
Write a short, friendly follow-up email to {!$Input:Contact.FirstName} {!$Input:Contact.LastName}, who works at {!$Input:Contact.Account.Name}.
Mention that we met recently and offer to schedule a call.
Keep it under 120 words and do not invent product details.Read the merge fields from left to right:
$Inputsays the value comes from a template input.Contactis the input object.FirstNameandLastNameare fields on that Contact.Account.Namefollows the Contact's relationship to its Account and reads the Account's name.
At run time the model never sees the placeholders. It sees text such as "Write a short, friendly follow-up email to Dana Ortiz, who works at Northwind Traders." This is why grounding matters. The model gets real values and has less reason to guess.
Instructions that shape the draft
The text around the merge fields controls tone, length and boundaries. The example above does three things:
- It sets a tone: short and friendly.
- It states the goal: mention a recent meeting and offer a call.
- It sets constraints: under 120 words, and no invented product details.
The last constraint is important for sales content. A model that is not told otherwise may add product claims, prices or dates that sound plausible. Telling it not to invent details reduces that risk but does not remove it. The rep still has to check the draft.
Where the recipient and context come from
When a rep opens the email composer from a Contact or Lead record, Salesforce supplies that record as the input. The template can then read any field on it and follow relationships to related records.
This works well for fields on the Contact and its parent Account. It gets harder when you need data that is not on a direct path. For example, an Account can have many Opportunities. A merge field cannot choose "the most relevant one" by itself. If you need that kind of context, you have two common options:
- Add a resource that retrieves the data, as described in the grounding chapter. A resource can be a flow, an Apex class, or a related list, depending on what your org offers.
- Add a field on the Contact or Account that holds the value you want, and refer to it in a merge field.
Either way, check what the model actually receives. The preview feature, covered in the testing chapter, shows the resolved prompt.
A worked example
Suppose a rep wants a follow-up after a trade show. The marketing team wants every draft to follow the same structure. Here is a fuller template:
You are writing on behalf of a sales rep at our company.
Write a follow-up email to {!$Input:Contact.FirstName} {!$Input:Contact.LastName}, {!$Input:Contact.Title} at {!$Input:Contact.Account.Name}.
Requirements:
- Mention that we met at the recent trade show.
- Refer to their industry: {!$Input:Contact.Account.Industry}.
- Offer a 20-minute call next week.
- Use a friendly, professional tone.
- Keep the email under 120 words.
- Do not mention prices, discounts or product features.
- If a value above is empty, leave it out instead of guessing.
- End with a short subject line suggestion on its own line, starting with "Subject:".This template follows several habits worth copying.
- A role sentence. It tells the model whose voice to use.
- Structured requirements. A short list is easier for the model to follow than a long paragraph.
- A fallback rule for empty fields. Not every Contact has a Title or an Industry. Without a rule, the model may fill the gap with an invented value, or the sentence may read oddly.
- A defined output shape. Asking for a subject line in a fixed format makes drafts consistent.
What the flow looks like
The diagram shows how a draft moves from the template to the rep's inbox.
The Trust Layer step is covered in its own chapter. For now, note that the prompt does not go straight to the model. It passes through a layer that applies data protections first.
Activation and use
A template does not reach reps until it is active. A draft template can be previewed in Prompt Builder, but only an active version is available to users. After activation, reps reach the template from the email composer on supported record pages, where they can pick it as a source for a generated draft. Your admin may need to give users the right permission set before they see the option.
If reps cannot see the template, check these in order:
- The template version is active.
- The user has the permission set that grants access to prompt templates.
- The record page and the composer you expect to use are set up to offer generated emails.
- The template type matches the context. A Sales Email template needs a Contact or Lead as the recipient.
Common errors and how to avoid them
| Problem | Likely cause | What to do |
|---|---|---|
| Draft says "Dear ," or leaves a gap | A merge field points to an empty field | Add a rule to leave out empty values, or fill the field |
| Model invents product facts | The prompt gives no facts and no limits | State what to avoid, or ground the draft in real data |
| Draft ignores the recent interaction | The prompt mentions an interaction the model cannot see | Pass the data in through a resource, or reword the prompt |
| Draft is too long or too casual | Tone and length are not specified | Add explicit limits and a tone |
| Merge field shows as raw text in preview | The field name or relationship path is wrong | Re-insert the field with the picker instead of typing it |
| Template is missing from the composer | The version is not active, or access is not granted | Activate the version and check permissions |
A frequent mistake is writing "mention our last call" when no call data reaches the prompt. The model has nothing to ground that sentence on, so it either produces vague text or makes something up. Only refer to facts that the template actually supplies.
Sales Email compared with the other types
Sales Email is the narrowest type, which is its strength. It knows the output is an email and the recipient is a person. Compare it with its neighbors:
- Field Generation writes text into a field on a record. It does not produce an email draft.
- Record Summary condenses one record into a summary. It is not addressed to anyone.
- Flex takes flexible inputs and is not tied to a single record. Choose it when your email depends on several different records, or on text supplied by the caller. Note that a Flex template does not appear in the email composer on its own.
If your case is "draft an email to this person using this person's data," Sales Email is the right fit. If the case needs unusual inputs, move to Flex and accept that you must wire its output into the place you want to use it.
Design checklist
Before activating a Sales Email template, check each item:
- The prompt names the goal, the tone and the length.
- Every merge field was inserted with the picker and resolves in preview.
- The prompt says what to do when a value is empty.
- The prompt forbids invented facts that your org cannot back up.
- You tested at least one record with complete data and one with missing data.
- Reps know they must review the draft before sending.
Exercise
A rep says the draft opens with "Hi ," and mentions a company called "Account" in the second sentence. Name two likely causes and one fix for each.
Show answer
First, a merge field such as the Contact's first name is empty on that record, so nothing is inserted. Fix it by populating the field or by adding a line telling the model to leave out empty values. Second, the merge field was typed by hand with a wrong relationship path, so the text was not resolved. Fix it by re-inserting the field with the picker and confirming in preview that it resolves to a real value.
Exercise
You want a Sales Email template to mention the customer's largest open Opportunity. Why is a simple Contact merge field not enough, and what can you do?
Show answer
An Account can have many Opportunities, and a merge field cannot pick the largest one. Either add a resource, such as a flow, that finds and returns that Opportunity, or store the value in a field on the Contact or Account and reference that field.
Exercise
Why should a Sales Email prompt include the instruction "do not invent product details"? Does the instruction remove the risk?
Show answer
Without limits, the model may add plausible but false claims about products, prices or dates. The instruction lowers the risk but does not remove it, so the rep must still review every draft before sending.