Dynamic Clickable Email Hyperlink Dynamics CRM 2011 Workflow

Paul Nieuwelaar, 25 June 2012

In a previous blog post, I mentioned about using hyperlinks in workflows. The example I used was creating a hyperlink to the record using the record URL in the form assistant. In this post I will be showing how we can use this Hyperlink feature in workflows to create clickable hyperlinks that open a new email message in outlook to a dynamically changing email address from CRM. I will also show how we can use standard HTML ‘mailto:’ to set a Subject, and even a Description on the email message once opened.

Dynamic Clickable Email Hyperlink Dynamics CRM 2011 Workflow 

To create your dynamic email hyperlink, open up the Properties on a Send e-mail, or Create Email step within your workflow. We will use the ‘Insert Hyperlink’ button to generate the <hyperlink> tags. Click this button, and then click OK without entering any values directly into the ‘Text to display’ or ‘URL’ fields of the Insert Hyperlink screen just yet. This will insert the empty <hyperlink> tags into your workflow.

You can also just copy the following text into your workflow:
<hyperlink><name></name><value></value></hyperlink>

Dynamic Clickable Email Hyperlink Dynamics CRM 2011 Workflow 

You can now enter your ‘Text to Display’ between the <name> tags, and the ‘URL’ between the <value> tags. These can use the dynamic values from the form assistant, and also just static text.

To create an email link; between the <value> tags, we want to enter something like this:
mailto:{E-mail}?subject=RE: {Topic}

You need to replace {E-mail} with the dynamic value from the form assistant, and replace {Topic}, or enter any subject you want; using static or dynamic values. You can also use this handy tool to generate the URL to be used in the <value> tag. You will still need to insert your dynamic values later, but it makes it a lot easier to add the Subject, and even a Description, To, CC, and BCC values if necessary.

Once you have created the <hyperlink> it should look something like this:

 Dynamic Clickable Email Hyperlink Dynamics CRM 2011 Workflow

When you test your workflow, the email message created will convert the <hyperlink> tags into a clickable hyperlink that when clicked opens a new message using the details you set in the workflow. If you set a Subject, or Description in the ‘mailto:’ link, these will be prefilled in the email message.

Dynamic Clickable Email Hyperlink Dynamics CRM 2011 Workflow