Email Template Demystified

Before I start this blog – I would like to mention that my previous blog on email template functionality How to insert dynamic values from custom entities in an email template – Microsoft Dynamics CRM has been a huge success and got 10K + views on both Dynamics Community and on my personal blog.

In this blog I am going to cover below:

  1. Using HTML in email template. I.e Adding a table, border etc.
  2. Adding images to email template, prerequisites, limitation etc
  3. Using desired fonts


Quick Tips:
1. Always use Internet Explorer when creating email template
2. Adjust IE settings to be in compatible mode with your CRM. (i.e adding CRM url to compatibility mode)


Using HTML in email template. I.e Adding a table, border etc..

The first question would be , what is the need to use html in email template? If you know email template has very limited option available from the designer such as limited number of fonts, Colors, font size etc. So using html to provide rich look to your email content can be a good choice. I have used them personally and customer loved them.

In this blog I will quickly create a basic html email template which will have a table with some information from CRM record and we will beautify it. Lets say i would like to create table with custom loyalty reward information. I can do something like below:

You can use any online html editor to create the required content like the one I used here:  

Now save the template and go to a contact > activities > add an email and insert this email template:

This is just to show the capability. You can do a lot with HTML in your email template.

Adding images to email template, prerequisites, limitation etc.

Adding images to a email template has been very tidy work. However with correct knowledge its quiet easy.  Keep below in your mind when you want to add an image to an email template:

  1. Email template is not a container/storage. The image can only be referenced from a public source. Meaning image must be available/accessible public ally.  i.e located on sharePoint, company website, social network public image etc.
  2. You should set the image size using html rather then manually dragging the corners.

Lets take an example below. I would add an image to my email template showing my recent accomplishment which is available on my blog page:

Now if I need this image in email template. There are two options.

1. Copy the image directly by right clicking on the image from website or create an html using image. Open in browser and copy from there and paste in your email template:

however this method is risky as your image might vanish anytime.

2. Copy image hyperlink or image address and paste it and create html by proving the image source:

Save the template and insert into email and you will see image has been populated.

Quick Tip : You can store images as Image web resource within your dynamics CRM and use them like I have used above by simply taking the image web resource url.

Using desired fonts

Though template editor gives you very limited option on fonts and size. You can very add other fonts and desired size or any colour to your content.


Here is what you can do:

  1. Format your content on a word document and copy paste from there into your email template. It should retain the fonts, size and color.
  2. Set the formatting within your HTML.


<p><strong><span style="color: #ff0000;"> Rawish Kumar</span></strong></p>

I hope this helps!

Feel free to contact me in case of any difficulties.


Attach a static PDF to OOTB D365/CRM Workflow

So a recent requirement put to me was to send an email to customers with a specific attachment.

There was also a requirement to ensure the right people would get the email but that was fairly straight forward and manageable through Advance Find/Fetch XML.

I was quite keen to avoid development of a custom workflow activity or plugin to cater for this business objective.

After some investigating I found a fairly straight forward solution:

  1. Create an email template with the body/dynamic tags you wish to and attach the static attachment(in my case a PDF) here
  2. Create your asynchronous workflow as you normally would with the conditional logic and trigger points
  3. When adding the send email action, choose to use email template and call in the email template within the workflow

Simples :)!

Know if an email has been replied or worked upon

This is very common question that i get on community or on other forums on how to identify if an email has been replied or worked upon by a user.

Well the easiest approach to tackle this is that there is a field on emails as parentactivityid  which can be used and put on the views, this field basically will contain the email on which you have replied.

So if this field contains data, it means someone has replied on this email.

for example , see below :


  1. My first email doesn’t contain anything in the parentactivityid because its a fresh sent email.
  2. My second is actually the email which i have sent above – it has the parent activity id as the first email.
  3. My third email is a reply on the previous email received, hence it has that in the parentactivity id column.
  4. My last email is the received email which has the parentactivity id as the email which i sent previously.

Hence, the logic should be like.


Email direction = incoming

parentactivityid = contains email

Action = you have to reply to this email.


Email direction = outgoing

parentactivityid = contains email 

Action = it means it has been replied.


Email direction = incoming

parentactivityid = doesn't not contains emails

Action = you have to work on it


Email direction = outbound 

parentactivityid = doesn't not contain email

Action = its a fresh email.

I hope it makes sense.