How can I resolve related record merge fields in Email Templates in e2a?

Introduction

From e2a v3.4949 onwards, a new feature of resolving related record merge fields have introduced. Traditional resolution of merge fields, which is offered by Salesforce, does not allow you to refer to fields of a related record.

 

For example, if you are creating a template with 'Contact' as Related Entity Type and if you want to include 'Account Name' of the related account then it is not possible with current available functionality. But, with this enhancement in e2a now you can refer to merge fields in email templates such as Contact.Account.AccountName.

 

This feature can be utilized using Ortoo Email Template Assistant streamlines the creation of relationships between different templates, ensuring seamless resolution of merge fields from related or child objects. It also simplifies handling CC/BCC merge fields on the target object.

 

But, first we need to enable related record merge fields resolution custom setting.

How to enable Related Record Merge Fields resolution in e2a?

We need to create a Custom Metadata Type and add a setting record:

 

  1. Press on 'New'.
  2. Enter the Name as: Allow_Relationship_Merge_in_Template.
  3. Enter the Label as: Allow_Relationship_Merge_in_Template.
  4. Enter the Value as: true
  5. Press 'Save'

 

To add the assistant in any of the desired App:

  1. Go to "Setup" in quick find search for "App Manager" select the desired app and edit it
  2. In the App setting, go to "Utility Items" select add Utility item.
  3. Search for Ortoo Email Template Assistant.
  4. Label it "Ortoo Email Template Assistant"
  5. Press Save.

 

Now you can easily access the Ortoo Email Template Assistant over the desired app.

 

How to add relationship between templates to resolve related record merge fields?

  1. Make sure you have already created an email template (can be referred to as 'child template') which contains local/normal merge fields in it. Let's say you create a template with 'Related Entity Type' of Account and use the merge field {{{Account.AccountName}}} in email body.
  2. Now create a main/parent template which you will be loading on the e2a email client. Let's say you create a template with 'Related Entity Type' of 'Contact'.
  3. Open the Ortoo Email Template Assistant from the template detail page of above created template.
  4. Select action 'Add a Relationship to a parent or child record(s)'.
  5. Select the appropriate Context Object.
  6. Select the desired field to resolve.
  7. Press Confirm Selection.
  8. Now Select the Email Template you want to create a relationship with. This will a normal email template with usual merge fields.
  9. Press Update HTML Content
  10. Press Copy to Clipboard or select the text using Ctrl/Command+C.
  11. Copy it to the Parent/Desired Template to utilize it.
  12. Now, loading of this main/template on e2a email client should result in the resolution of the relation shown in above step in such a way that it shows the account name of the respecive account of the contact selected in 'To' field.

Where can I manage this setting after it is created?

Once the setting is configured, you can manage it by navigating to Setup > Custom Metadata Types > e2a_Customer_Settings__mdt > Manage. Here, you can create, update, or delete records as needed.

Why use Custom Metadata Types for this setting?

Using Custom Metadata Types allows you to store and manage configuration settings at the application level. This approach provides flexibility and central control without requiring custom code, making it easier to maintain and update your settings across your Salesforce organization.

Is this approach recommended by Salesforce?

Yes, Salesforce recommends using Custom Metadata Types for settings like this. It provides a scalable and maintainable way to manage configurations within your Salesforce environment without modifying the underlying code.

 

Please contact us at support@ortooapps.com for any questions.

 

 
Was this information helpful?
Quick survey: How do you rate Email-to-anything?
★★★★★ - EXCELLENT
★★★★ - GOOD
★★★☆☆OK
★★☆☆☆POOR
☆☆☆☆ - RUBBISH

-