So my problem I open up my contact to view the emails that have been sent via ClickDimensions, when I open the email I see the subject of the email that was sent but not the content. To get to the content I have to click the link to the email send record. This can be frustrating to users who what to get a quick view of the email content.
This started me thinking, if we can view a preview in the email send record then maybe we can construct the correct URL and display that in an iFrame in any related record. After a bit of playing and an email with Matt Wittemann from ClickDimensions I had a nice solution.
I thought I would share this and if I am honest as I am not a developer I would probably convert a couple of my steps into plugins rather than using workflows! Anyway this is how I achieved the solution.
First of all if we take a look at the URL in the preview of an Email send record, it looks something like this:
Now the only thing that changes by email send is the email send GUID. So if I know the GUID of an email send record then I can display the email in any iFrame, simple!
Remember now that I am not a developer so my tools available to me are workflows, fields and web resources! This is how I did it:
- I utilised the GetRecordID workflow function provided by ClickDimensions in the blog (http://blog.clickdimensions.com/2013/02/link-a-survey-response-to-a-case.html)
- I created a new field on the Email Send record to hold the GUID of the record
- I created a workflow on the Email Send record that on create uses the GetRecordId action and populates the returned value in the new field (This could be a plugin instead of a workflow)
- Save and publish the workflow
- In the Sent Email entity
- Create a new field to hold the URL of the preview
- Create a new iFrame that will display the preview
- Create a simple Web resource to take the value of the URL field and update the iFrame URL as below:
- function Emailsend()
{
var emailsendurl = Xrm.Page.getAttribute(“new_emailsendurl”).getValue();
Xrm.Page.ui.controls.get(“IFRAME_emailsend”).setSrc(emailsendurl);
}
- What I did then was to use another workflow on the Sent Email to generate the URL into the Sent Email URL field, using the standard preview URL as above and populating the GUID from the related Email Send. This could equally of been done in a plugin on the create of an Sent email record.
- When I publish all of the components I now have the preview of the email that was sent displayed in my Sent Email record.
