Links in e-mail templates

It is not so hard to get a link in a CRM template, but to hide the link behind your custom text is more difficult. It is possible to do so though. I noticed a small post in the communities by my fellow MVP Adi Katz in which he explains how you can do this. This post does deserve a bit more attention so that's why I am copying the content in this blog post. And now I can find it back as well :)

Adi Katz:
You need to create a new text attribute (e.g. new_workflowhref ) that holds an entire Anchor HTML tag with the HREF property set to the desired link.

Here is a simple example:


<a href=”http://[server]:[port]/[organization name]/userdefined/edit.aspx?etc=10016&id=40f03814-8544-dd11-b4d5-0003ff230264”>click here for more information</a>

You need to set this attribute on a post create event using a plug-in OR you might use Ajax to set this attribute when the form returns after creation e.g.

crmForm.FormType == 2 && crmForm.all.new_workflowhref.DataValue == null

Insert the new_workflowhref field inside the email body. The workflow should run when the new_workflowhref changes.

Cheers,
Adi

No comments: