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:
- Email Template Information
- Folder: MyEmail Templates {Select the folder in which you want to save the template}
- Available For User: Select the checkbox {if the checkbox is not selected, then you can’t use this template}
- Email Template Name: Contact Associated with Account
- Template Unique Name: will auto-populate
- Encoding: Keep it the default one selected
- Description: Write appropriate text, which helps to understand the purpose of this email template
- Visual Template Attributes
- Email Subject: Contact Associated with Account:
- Recipient Type: User
- Related To Type: Account
- 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 would love to hear from you! What did you learn from this post? Share your tips in the comments!
Step by step explained well.Thanks