Home | Cool ClickDimensions Features | Merge any Custom or Standard Entity Data into ClickDimensions Emails

Merge any Custom or Standard Entity Data into ClickDimensions Emails

Note: This is an updated version of an older post, which can be found here.

Recently we had a customer that wanted to have standard email templates that could bring in data from standard and custom entities. But there was a twist; they also wanted to be able to bring in multiple records for some entities. Here is the scenario: the customer is in the home building industry and they wanted to have a standard template that could contain information about the recipient the template was being sent to, as well as information about a specific subdivision and various homes in that subdivision.

A simplified version of the email template is pictured below. This could easily be complex HTML with graphics and formatting, but we are using this example for simplicity. You can see that in line one of the email, the template brings in the recipient’s (contact) full name. Then, in the next line, it brings in the name of a subdivision (a custom entity) and then a table with information about that subdivision. Below that, the email template will include information about one or more home records. This is achieved by using the FreeMarker list directive. FreeMarker is an open source template markup language that the ClickDimensions email engine uses for complex dynamic content.

The data fields in the template can come from any custom or standard field or entity in CRM. You add fields by simply using the same syntax that our standard data fields use. For example, ${Recipient.lead.firstname[0]!””} represents the first name field on the lead record. Following this syntax, we can include any data in the template. For example, if you have a custom entity named New Subdivision with a field named New Name, you can place the data field ${Recipient.new_subdivision.new_name} into your template (note that the characters [0]!”” at the end of the lead first name field are used to specify placeholder text and are optional).

New homes email template

Below is what the custom subdivision entity looks like. Prior to the email being sent out, our images appear as broken links because the source path for the file is being handled by FreeMarker as well. Once the email goes out, the source path will be dynamically pulled from the relevant subdivision or home record and display the appropriate image. Note that it also has home records linked to it (home is also a custom entity).

This is what our subdivision entity looks like in CRM. Relevant homes are connected to the subdivision and accessible through the related menu, and the aforementioned images can be seen at the bottom of the record.

Subdivision record

Below is what the home custom entity looks like. It also has paths to image files.

Home Record

Now that the email template is ready, we need a way to specify which subdivision and which homes should be merged into the template. We do this by using the CRM Connections feature. We simply link a subdivision and one or more home records to the ClickDimensions email send record using the standard CRM Connections functionality on the email send record. In the case of our subdivisions/homes example, we will link a subdivision record to the ClickDimensions email send record.

Subdivision lookup

Then we will link any number of home records to the ClickDimensions email send record. The result is that we have one subdivision and several home records linked to the email send record.

New homes email send connections

Of course, the email template we showed above is also linked to the ClickDimensions email send record.

New homes email send

Now we just add some recipients (leads, contacts, accounts and/or marketing lists in any combination) and when we send our email, all the data from the recipient, subdivision and home records are merged into the resulting email. Again, this was not meant to be a fancy email, but we could just as easily have formatted it any way we wanted.

Sent email

This has been a complex example, but hopefully you are seeing the power of our merging capability, as well as the advantages of enabling dynamic content through the FreeMarker language.

Happy Marketing!

About the Author:

mm
Rhys Saraceni is a Training Developer at ClickDimensions.

4 Comments

  1. Christina July 31, 2017 at 5:52 pm - Reply

    Hi Liz,

    It looks like you are using the freestyle code editor, would I also be able to do this using the drag and drop editor?

    Please Advise,
    Christina

    • mm
      ClickDimensions Marketing July 31, 2017 at 7:45 pm - Reply

      Thanks for your question, Christina! This is definitely possible in the ClickDimensions drag and drop editor as well.

  2. Christina October 10, 2017 at 5:54 pm - Reply

    Hi There,

    Is it possible to do this same process but with custom entities related to the contact record. I have a custom entity called interviews and I want to show only the interviews that are associated with the contact I am sending the email to.

    Is this possible?

    Thanks,
    Christina

    • mm
      ClickDimensions Marketing October 26, 2017 at 2:17 pm - Reply

      You absolutely can use custom entities (the entities in the example are custom entities), but they will have to be connected to the email send itself. Unfortunately, the FreeMarker doesn’t preemptively have a way of knowing which records are connected to the recipient contact and which aren’t, so the options here are either to only connect the specific interview records that are associated with the recipient, or if there is some field on the interview record that would indicate that it is connected to this particular recipient, you could set up a conditional statement inside the list such that it would only show connected interviews if the record is associated with the recipient.

Leave A Comment