Saturday, January 30, 2016

Workaround for Email Template Limitations

In Dynamics CRM, you can create entity specific email templates only for the following entities: Account, Contact, Lead, Opportunity, Case, Order, Quote, Invoice, Contract and Service Activity. You can also create a generic global email template.


However, there are many use cases where users need an ability to create and use email templates for other standard entities such as Appointment as well as for custom entities.

Standard email templates also have other limitations. For example, when you are creating an email template for the Opportunity entity, you can only insert fields from the related Contact or Account. There are situations where you may want to pull information from other related entities including custom entities into an email template.
You can take advantage of standard CRM dialog as a workaround for these limitations. This solution essentially offers the same capabilities as standard email templates for any standard CRM entity as well as custom entities.
In this example, user wants to send an email to a customer for an existing Appointment. However, user wants to be able to edit the content of the email before sending it. Because you cannot create an email template for the Appointment entity, we will use the following solution which provides the same capability as the email template.

We will create a Dialog for the Appointment entity with the following steps.
  1. Create an email.
  2. Change the status of the email to “Draft”.
  3. Display a hyperlink to the draft email as the last step. User can click on the link to open the draft email, edit it and then send it to the customer.

Here’s the screenshot of the sample dialog.



When a user runs this dialog on an existing Appointment record, the dialog creates a draft email and displays the link as follows:

A user can click on the link to open the draft email, edit it and click send.

You can use this technique for other standard CRM entities as well as custom entities in your solution.