Inserting HTML in CRM 4.0 workflow generated email with dynamic fields

I ran into an interesting problem when trying to create an email generated through workflow that contained HTML and CRM dynamic fields.  The main problem was the pictures included in the html message.  Well actually, the main problem was the lack of an html editor in the CRM email editor.
To get some html in the email body, I copied and pasted from Microsoft Word.  The standard html, such as links and text areas, seemed to work fine but the pictures would not show up.  The issue was that I was using Microsoft Word.  I used Internet Explorer (IE) and the correct content displayed.  I am sure you can probably use some other html editors but I only used IE.
Here are the steps I followed.
1.  The first thing that you need to do is to have an html page.  If it contains images, those images need to be on an external server and the urls in the html need to point to the location on the external server.  The simple way to test this is to save your html page to a folder and ensure there is not a folder named images in that folder.  Now open the html page in Internet Explorer (IE) and make sure you can see all of the content.
On a side note, it is possible to have the images show up if the image path points to a location on your network that you have access to so don’t get fooled by that.
2.  Once you can successfully view the email in IE, select all the content on the page and copy it to the clipboard (Ctrl + C).
3.  Now you want to go into your workflow and click the "Set Properties" button to the right of you "Send e-mail" action.
4.  Paste (Ctrl + V) the html you copied from your browser into the body of the email you are creating.  Please note that using the paste button in the toolbar above the body probably won’t work.
5.  Now that your email has the html content you want, click your cursor where the CRM dynamic field to be placed and insert the field.  Sometimes, the dynamic field does not show up in the exact spot you want it to.  In this case, I will get the field in place by deleting the carriage return before the field and then adding another one after the field.  If my dynamic field ends up being placed at the bottom of the message, I delete it and add it back to the body in the correct location.
I have not been able to determine why the dynamic field gets missplaced.
2)Sending HTML Emails in Microsoft Dynamics CRM
One of the questions I’ve been getting about Dynamics CRM a lot lately is “Why can’t you create and send HTML based emails with images and other pretty stuff”?
Well, you can. It’s just not obvious. When you go to create an email template or just send a web form email through Dynamics CRM you won’t see anything that says “add image” or “upload HTML file”.  It looks like the only options are simple stuff like changing font color and creating bullet lists.  If you try to copy and paste HTML code you just end up with HTML code.
There’s a “hidden feature” of Microsoft Dynamics CRM 4.0. It’s called Copy and Paste. That’s right. You can copy and paste a webpage into a Dynamics CRM email form or template and it should show up perfectly (unless the HTML code is crappy).
Perform the following steps to get the hang of how to do it:
Open Internet Explorer (I’m using version 7.0) and go to your favorite website (yes, any website)
Somewhere in the webpage click the right button on your mouse and click “Select all” from the option list
Click the right button on your mouse again and click “Copy”
Open Microsoft Dynamics CRM
If you’re using CRM for Microsoft Outlook, open Outlook, go to the top menu area where it says “File, Edit, View, etc) and click CRM, and click “Options” from the list
If you’re using the web based version of CRM, go the top menu area, click “Tools” and select “Options” from the list
On the Set Personal Options window that opens, click the “Email Templates” tab, click the “New” icon, choose a Template Type
On the Email Template form that opens, place your mouse cursor in the large text area and do a Ctrl-V paste with your keyboard (press and hold the “Ctrl” key while simultaneously pressing the “V” key)
Ta-da! You should see the exact webpage with images, colors, and links
So you’re thinking “that’s great but how the heck do I get the marketing newsletter from my HTML editor into CRM”? Here are a couple more things to note:
Most popular HTML editors, such as good ole’ Microsoft Frontpage, have a few different editing modes like “code” and “design”. In the design mode, copy the webpage (not the HTML code) and paste it into the CRM email.
The email images must be stored somewhere where your email recipients can have access to view them. Since most people that receive your email won’t have security permission to access the images on your computer you’ll need to transfer them somewhere accessible. One option would be to talk to your website administrator about putting them on your company’s website server (e.g. You’ll just need to make sure your HTML code path matches the location of the images.
 After you get the hang of this it’s pretty easy.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: