Sections in this category

Insert Dynamic Text in Email Templates

As with most Microsoft Dynamics features, Email Templates can be built to dynamically pull information from a related entity including Contacts and Accounts. This will allow you to create more personalized communication with your customers.

Microsoft Dynamics has out-of-the-box functionality to easily insert specific dynamic text (aka merge fields) from a related entity for certain Template Types. However, since the Global Template Type can be run on any entity and is not tied to any one entity, it is limited in the related entities that it is able to merge fields from. Therefore, Cobalt has found a way to manually create dynamic text values that can be inserted into an Email.

The following article details the notation you can use to do this.

Values Needed for Dynamic Text

The format of the dynamic text will require you to have the Logical Name (Schema Name) value of the Entity and the Logical Name (Schema Name) value of the Field that you want to pull information from.

How to get the Logical Name of the Entity

How to get the Logical Name of the Field

Dynamic Text from a Field on the Entity the Email Template is Run On (Non-Lookup fields)

General Format:

{!entitylogicalname:attributelogicalname;}

Scenario:

The Global Email Template will be run on the Meeting Registration entity and you want the greeting of the Email will to include the Badge Name. Therefore, you will need to create a Dynamic Text value that will pull the Badge Name field from the Meeting Registration entity.

Dynamic Text:

{!cobalt_meetingregistration:cobalt_badgename;}

Note: When you save the Dynamic Text value in the Email Template, the system may alter it slightly so that it displays like the following.

Result:

Jane

Desired data: Multiple steps to a single field:

Format: {email:to:cobalt_address1_stateprovinceid:cobalt_countryid:cobalt_isoalpha3code}

Result: USA

Desired data: Field on the recipient

Format: {email:to:lastname}

Result: Smith

Desired data: Field on the regarding object (meeting name)

Format: {email:regardingobjectid:cobalt_name}

Result: Association 2012 Midyear Conference

List of the names of people CCd in the email (with a semicolon seperator:

Format: {email:cc(; ):fullname}

Result: Inman, Russ; Capistran, Chris; Rossi, Peter

General Format

{email:(field on the email):(relationship schema):(relationship schema):(attribute or relationship schema)}

If you are specifying a 1:N or N:N relationship that can result in multiple values, a default separator is used (a comma with a space). If you want to override the separator, you can specify that in parenthesis immediately after the relationship’s schema name:

{email:to:order_customer_contacts(…)}

{email:to:order_customer_contacts(…):totalamount}

**NOTE: If there is any HTML formatting in the placeholder, the placeholder will not work, so to make sure that there is no HTML formatting copy the placeholder into notepad or write it directly in notepad and then paste it into the email.