<img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=259446424624044&amp;ev=PageView&amp;noscript=1">

Fullscope Blog

A real-world look at digital transformation.

Dynamics 365 Tips: How-to Send an Email to Special Contacts

By Natasha Spurr | January 18, 2017

How to override the default email address when sending an email to a contact

On a recent Microsoft Dynamics 365 project we had a requirement to protect the contact’s email address. Naturally, field level security was the obvious choice to protect the email address. Since protecting the primary email address (emailaddress1) is not allowed, we had to introduce a new custom email field.

Therein lies the challenge. When sending an email to a contact, CRM automatically refers to the default emailaddress1 field. However, for special case contacts, this email address needs to be stored in the, field-level security protected, new custom email address field. Storing this value in the default email address would defeat the purpose of protecting its value. So, the challenge our Technical Architect faced was, how to send an email to special contacts.

In short, the solution is to intercept the newly create email record and replace the ‘addressused’ attribute.

Below is sample code demonstrating how to accomplish this using a plug-in or custom workflow plug-in.

• Plug-in to send to alternate email address.
• Custom workflow activity, used by custom dialog to send an email.
Code Walkthrough

This plug-in code changes the email address used to send to the contact. It does not, however, address the above requirement of preventing non-authorized personnel of sending emails to special case contacts.

This code, if executed by a non-authorized person, would fail. The reason is that the un-authorized person does not have field level security to the protected email address.

Looking for more ways to use CRM better? Download the success guide for free today: 

Guide: 3 Keys to Successful CRM Adoption

About Natasha Spurr

Natasha is an experienced CRM professional with a unique ability to work across both marketing and sales functions. As CRM Marketing Manager at Edgewater Fullscope, Natasha has helped the organization to achieve multiple global partner awards and leadership status across the UK and beyond.


Latest Posts