HOW TO INSERT DYNAMIC VALUES FROM CUSTOM ENTITIES IN AN EMAIL TEMPLATE IN MICROSOFT DYNAMICS 365?

As a Microsoft Dynamics 365 consultant we often need to work with Email templates. Email templates save time while creating multiple Email messages. In Dynamics 365, specifying dynamic values from out-of-the-box entities is fairly straight forward but to add dynamic values from custom entities requires tweaking. Dynamics 365 does not provide an out of box option to populate the field values from a custom entity in Email templates.

Given below are the steps to achieve the same.
Step – 1:

Create an Email Template of Template type Global by following the below navigation:
1. Settings -> Templates
2. Click on on Email templates
3. Click on New

Dynamics 365 provides template for specific out of box entities only. Since we are using a custom entity, we need to select Template Type as “Global”.

Step – 2:
Provide a name for the template.
Define the Permission level of the template and then provide a description.

Step – 3:
Specify Subject and Email body in the template.

Following table provides syntax for inserting dynamic values from Custom entities.

Sr. No.Field TypeSyntaxExample
1Single Line of Text{!EntityLogicalName:FieldLogicalName;}{!new_Lead:new_leadname;}
2Lookup{!EntityLogicalName:FieldLogicalName/@name;}{!new_ Lead:new_leadid/@name;}
3Date{!EntityLogicalName:FieldLogicalName/@date;}{!new_ Lead:createdon/@date;}
4Time{!EntityLogicalName:FieldLogicalName/@time;}{!new_ Lead:createdon/@time;}
5Currency{!EntityLogicalName:FieldLogicalName;}{!new_ Lead:new_estimateam;}
6Decimal Number{!EntityLogicalName:FieldLogicalName;}{!new_ Lead:new_consultationfee;}
7Floating Number{!EntityLogicalName:FieldLogicalName;}{!new_ Lead:new_estimatedamount;}
8Multiline of Text{!EntityLogicalName:FieldLogicalName;}{!new_ Lead:new_address;}
9Multi Select Option Set{!EntityLogicalName:FieldLogicalName/@name;}{!new_ Lead:new_symptoms/@name;}
10Option Set{!EntityLogicalName:FieldLogicalName/@name;}{!new_ Lead:new_gender/@name;}
11Two Options{!EntityLogicalName:FieldLogicalName/@name;}{!new_ Lead:new_walkin/@name;}

Step – 4:
Save the email template and dynamic content is highlighted in blue.

Step – 5:
Create a new Email record and click Insert Template and select the Email Template which we have created above.

Verify the dynamic content and then click on “Apply Template” button.

Leave a Reply