Skip to content

Email Template to Show Related Records

Business Use Case

David is working as a System Administrator at Appiuss Software. He received the following requirement from his manager – Create an email template to send an email to the account owner with all contact details (i.e., Contact Name, Email Address, Phone Number, Department) associated with the account.

Perform the following steps to solve the above business requirement

Step 1: Log in to Salesforce Org, click on the Gear Icon, and click on SetUp.

Step 2: In the Quick Find box, search Classic Email Templates and click on it.

Step 3: Click on New Template, then select the Visualforce radio button and click on Next.

Step 4: Fill the details below:

  1. Email Template Information
    1. Folder: MyEmail Templates {Select the folder in which you want to save the template}
    2. Available For User: Select the checkbox {if the checkbox is not selected, then you can’t use this template}
    3. Email Template Name: Contact Associated with Account
    4. Template Unique Name: will auto-populate
    5. Encoding: Keep it the default one selected
    6. Description:  Write appropriate text, which helps to understand the purpose of this email template
  2. Visual Template Attributes
    1. Email Subject: Contact Associated with Account:
    2. Recipient Type: User
    3. Related To Type: Account
    4. Click on Save.

Step 5: Click on Edit Template and copy the below code and Save.

Sample Code

Your email template will look like this:

Verify:  Click on Send Test and Verify Merge Fields, and select User and Account to test the email template with sample data.

You are done!

I want to hear from you! What did you learn from this post? Share your tips in the comments!  

1 thought on “Email Template to Show Related Records”

Leave a Reply

%d bloggers like this: