Skip to main content

In todays post, HSD’s Dynamics Technical Consultant – Ash Dason runs us through a quick tip on how he solved an issue with Dynamics creating duplicate email tokens.


Emails created had duplicate tracking tokens, generated through Dynamics 2015.


We had a custom plugin workflow running a batch job to send emails out with some pdf attachments. The workflow was registered to run asynchronously. All the emails were successfully created and sent out around the same time. The plugin to send the email was running in the context of the SYSTEM user. When emails were generated using the job, all of them had duplicate tracking tokens.

However, when the same process was invoked by a user the emails had the correct tracking token.


  1. Analysis of the code showed there weren’t any instances that were manually setting the tracking token.
  2. Changing the tracking token settings in System Settings hoping this would “clear” the issue didn’t fix the issue.
  1. Manually setting the tracking token ( hoping this would override what the system does didn’t fix the issue either.


Finally we changed the plugin to Run in User’s Context and this fixed the issue. Remember to manually check the SDK plugin processing step after the deployment to ensure the step is overwritten. Some older versions of on premise CRM does not update the “run as” property even when the overwrite option is selected.

Make sure you check out more of HSD’s blog posts by visiting