HOW TO: Placing Images in to an Email Template

As a developer for MSCRM I never setup email templates or mail merge templates. Typical I get specifications for enhancing CRM through .NET work whether it be plugin assemblies, Silverlight applications or system integration work. Merging tends to be handled by the consultants so I never have visibility of it. Recently I found myself reading Vlad Arabajiev’s blog on Using Hyperlinks in Mail Merge which reminded me about an issue which was raised about embedding images in to an email template. If you have ever tried to create an email template you will know that there is no option for adding an image. If you want to add an image you have to make sure that it is hosted somewhere and copy & paste the source HTML which references the image.

Vlad’s blog has opened my eyes somewhat to the capabilities of mail merge, and how it can be used to send out emails! Casting my mind back I do remember some of this functionality from CRM 4 but like I said, being a developer I never really work with this area of CRM. That’s my excuse for my ignorance anyway :P, and that shows you how long ago it was since I thought about mail merging!

The title of this post maybe confusing as we are not going to embed images in to an email template. I just wanted to get your attention! We are going to add the images to a mail merge document, and send that mail merge out as an email. Email templates and mail merges do have their differences but the result they produce is pretty much the same. That’s why I can get away with my blog title. Using a mail merge our end result will be an email sent out using a template which has images on it. Some of my steps will be repetitive if you have read Vlad’s blog but for completeness I’ll add all steps.


Differences between Email Templates and Mail Merge Produced Emails

Here are some differences that I noted down.

  • Email templates allow you to save the email and add attachments. A mail merge email only allows you to add attachments if performing it through the Outlook client.
  • Entity targeted email templates only allow merging on one record. IE if your email is going to two contacts you have to select the contact that the merge takes place on. Mail merge emails can handle multiple records.
  • Email Templates are easier and quicker to set up than mail merge emails.
  • Mail merge produced emails allow you to insert resources such as images. With email templates, resources have to be hosted and referenced from the email.

Setting Up the Mail Merge Template

  • In MSCRM navigate to Settings > Templates and click Mail Merge Templates.
  • Create a new one, give it a name that tickles your fancy.
  • Set the associated Entity to be contact.
  • Leave the ownership as it is.
  • Save the record.
  • With the record still open click on Create Template in Word.
  • When Word finally opens up you need to locate and click on the CRM button that has been added to the ribbon.
Mail Merge CRM Button
Locate the CRM Button in Word
  • Ok the popup you receive.
  • Now simply type some text in to the document. If you wish to add a merge field use Insert Merge Field on the mailing tab and select a field to merge.
  • To add a picture, on the Insert tab select Picture and choose the image you wish to incorporate in to what will be your email. Below is an example of the mail merge template I set up in Word.
My Mail Merge Template
My Mail Merge Template
  • When you are happy with your document choose to Save As XML Document.
  • From the page you started the creation of your mail merge template select browse and choose the XML document you have just created.
  • If you have something that resembles the image below you may now save and close.
Mail Merge Record
Mail Merge Record

 Sending an Email Using the Template

  • While within CRM go to contacts and select a few.
  • Within the ribbon click Add, and select Mail Merge.
  • In the pop up select e-mail for mail merge type, and select your email template from the personal template lookup.
Select Mail Merge Template
Selecting the Mail Merge Template
  • Press OK and open up the Word document that is created.
  • Again locate and click the CRM button within the Word ribbon.
  • OK the popup that shows you the records you have selected to perform the mail merge on.
  • Within the ribbon under Mailings tab click Finish and Merge.
  • Select Send E-mail Messages. You will now see the merge options popup.
Merge Options
Merge Options
  • In To: select the field that contains the records email address.
  • Enter a subject for the email.
  • Now click OK to send the email, or if you have started the mail merge from within the Outlook client you will now have the ability to create the email as a CRM activity and track it. If this is the case choose to create the email as a CRM activity and then click OK to send.

When testing this I received the email within outlook and on my phone with the image correctly attached!

Received Email
Received Email

Tracking in CRM

When browsing to CRM, if you have used the Outlook client you have the ability before sending the email to create the email as a CRM activity and have it set regarding your current chosen records. If you have used the web client you will need to manually track the email in CRM. To do this I selected the email that had been sent in Outlook and chose to track in CRM. This matched my TO email address up with the correct contact record. Either way once done, the email and replies will be successfully logged in CRM.

A simply rule of thumb… If you require the email to be tracked you should alway start your mail merge from within outlook. The reason being that if you don’t start the process from Outlook you will have to finish the process in Outlook by manually tracking!

Tracked In CRM
Tracked In CRM
Tracked Reply
Tracked Reply

So now you can see you can use Word to create a very attractive looking document with loads of pretty images and email it out to your selected records!



Thankyou to Brett Meyer who pointed out the difference between mail merge in the outlook client and mail merge from the web client.

Leave a Reply

Your email address will not be published. Required fields are marked *