• WHO WE ARE
  • WHAT WE DO
    • Salesforce
      • Implementations
        • Sales Cloud
        • Service Cloud
        • CPQ
        • Field Service Lightning
        • Field Service for SMEs
      • Developments
        • Salesforce Customization
        • Custom Application Development
        • AppExchange Product Development
      • Migrations
        • Classic to Lightning Migration
        • Other Systems to Salesforce Migration
      • Integrations
    • Data Science
      • BI Solutions
      • AI/ML solutions
      • Agentic AI
  • HOW WE DO
    • Delivery Model
    • Our Works
  • REACH US
    • Contact Us
    • Careers
  • BLOG
    • WHO WE ARE
    • WHAT WE DO
      • Salesforce
        • Implementations
          • Sales Cloud
          • Service Cloud
          • CPQ
          • Field Service Lightning
          • Field Service for SMEs
        • Developments
          • Salesforce Customization
          • Custom Application Development
          • AppExchange Product Development
        • Migrations
          • Classic to Lightning Migration
          • Other Systems to Salesforce Migration
        • Integrations
      • Data Science
        • BI Solutions
        • AI/ML solutions
        • Agentic AI
    • HOW WE DO
      • Delivery Model
      • Our Works
    • REACH US
      • Contact Us
      • Careers
    • BLOG
  • [email protected]
  • (+91) 44-49521562
Merfantz - Salesforce Solutions for SMEs
Merfantz - Salesforce Solutions for SMEs
  • WHO WE ARE
  • WHAT WE DO
    • Salesforce
      • Implementations
        • Sales Cloud
        • Service Cloud
        • CPQ
        • Field Service Lightning
        • Field Service for SMEs
      • Developments
        • Salesforce Customization
        • Custom Application Development
        • AppExchange Product Development
      • Migrations
        • Classic to Lightning Migration
        • Other Systems to Salesforce Migration
      • Integrations
    • Data Science
      • BI Solutions
      • AI/ML solutions
      • Agentic AI
  • HOW WE DO
    • Delivery Model
    • Our Works
  • REACH US
    • Contact Us
    • Careers
  • BLOG

How to Send Email Alert to User by Using Visualforce email Template in Salesforce

  • August 1, 2017
  • Merfantz Editor
  • Salesforce Developments Tutorial
  • 0

Sometimes you need to send email alert which should include related list details also. You can achieve this type of alert by using the visual force email type template in Fieldax&Field Service Management. The below example to explain visual force email template.

For example, the Class Staff (Tutor) need to know the student information and his subject details.

Create New Template :–

Goto – Setup -> Administer -> Communication Templates -> Email Templates -> New Template

Then select visual force template format and enter the below code and click save.

Try the below code –

<messaging:emailTemplate subject=”Student and related Subjects” recipientType=”User” relatedToType=”Student__c” >

<messaging:htmlEmailBody>

Dear <b>{!recipient.Name}</b>,

The student <b>{!relatedTo.Name}</b> allocated in your our class. Kindly take care.

<p>Student Details</p>

<table>

<tr><th>Name</th><th>Address</th><th>Marks</th>

<th>Name</th><th>Address</th><th>Marks</th>

</tr>

<apex:repeat value=”{!relatedTo}” var=”s”>

<tr>

<td>{!s.Name}</td><td>{!s.Address__c}</td><td>{!s.Marks__c}</td>

</tr>

</apex:repeat></table>

</table>

<p>Subjects Details</p>

<table>

<tr><th>Student Name</th><th>Subject-1</th><th>Subject-2</th><th>Subject-3</th></tr>

<apex:repeat value=”{!relatedTo.Subject__r}” var=”v”>

<tr>

<td>{!v.Name}</td><td>{!v.sub1}</td><td>{!v.sub2}</td><td>{!v.sub3}</td>

</tr>

</apex:repeat>

</table>

</messaging:htmlEmailBody>

</messaging:emailTemplate>

 

Note:

relatedToType – This is specified object which one details you want to send.

messaging:htmlEmailBody – This tag is used for you can include HTML tags inside it otherwise you can use ‘messaging:plainTextEmailBody’ tag.

{!relatedTo.Name} – This is refer student object

{!relatedTo.Subject__r} – This is referred student object related object contains double underscore with r.

We are the ISV Partners and Please reach us for custom development => www.merfantz.com

—————————— We hope it will help to you ——————————

Author Bio

Merfantz Editor
+ Recent Posts
  • August 4, 2023
    How to Setup CRM Analytics for Financial Services Cloud
  • August 2, 2023
    How to Get Started with Salesforce Hyperforce - Merfantz
  • July 28, 2023
    Health Cloud Mastery: Salesforce Trailhead for Effective Healthcare CRM
  • July 26, 2023
    How to integrate Data cloud and Marketing cloud In Salesforce
Tags: Field Service ManagementFieldax
  • Previous To Modify Task Composer on Activity Tab in Lightening
  • Next How to View Button in Salesforce1

Leave a Reply

You must be logged in to post a comment.

Merfantz Technologies is a leading Salesforce consulting firm dedicated to helping small and medium enterprises transform their operations and achieve their goals through the use of the Salesforce platform. Contact us today to learn more about our services and how we can help your business thrive.

Discover More

Terms and Conditions
Privacy Policy
Cancellation & Refund Policy

Contact Info

  • No 96, 2nd Floor, Greeta Tech Park, VSI Industrial Estate, Perungudi, Chennai 600 096, Tamil Nadu, INDIA
  • (+91) 44-49521562
  • [email protected]
  • 9:30 IST - 18:30 IST

Latest Posts

Let Einstein Help You Build - Salesforce Flow
Let Einstein Help You Build – Salesforce Flow May 15, 2025
Mastering Attachment Compression for Salesforce Developers May 9, 2025
Salesforce API Integrations: Connect with Slack, Zoom, and Teams May 2, 2025

Copyright @2023 Merfantz Technologies, All rights reserved