Pending Send Emails

I came across an issue with emails generated through workflows in Microsoft Dynamics CRM 2013. The status Pending Send was the trigger to have a look at the email activities. I noticed the message on top of the form “This message has not yet been submitted for delivery”, and I had no idea why. Until now.

The problem

In the environment we successfully installed and tested the Email Router for CRM 2013. I had some custom workflows set up that created email messages to inform our users about important changes to their records. However, these messages never delivered. I assumed that the Email Router would process all email activities with status ‘Pending Send’, but it didn’t. The error message: “This message has not yet been submitted for delivery. For more information, see help”.

The solution

When a workflow creates an email message, CRM inserts a Null value into the deliveryattempts attribute of the email activity record if you don’t specify a value in the “No. of Delivery Attempts” field. The email router always looks for this attribute and checks whether the deliveryattempts value is 0 or greater. The Null value is being ignored and that’s the reason why my email activities weren’t being sent out.

I updated the field “No. of Delivery Attempts” in the workflow step and set it to 1. Now, this only resolved the issue for the emails that are going to be created in the future, but I still had a list of Pending Send emails.

update-email-workflow

No. of Delivery Attempts in update record (= workflow step)

I then created an on-demand workflow that set the status to draft first, I added another step to update the email record with the “No. of Delivery Attempts” and then again a step to update the status to Pending Send. I ran this workflow for every record that failed.

Problem solved.

NOTE: I used the value 1 in the field “No. of Delivery Attempts“, but you could put 0 as well. Anything greater than 0 will work.

5 Reacties op “Pending Send Emails

  1. Thanks for the article. It is really helpful. Another thing to check specifically for 2013 is to make sure the credentials are loaded for the user in their new 2013 Mailbox

    Like

  2. In case anyone comes across this article while researching an issue (likely future forgetful me), note that if you are using CRM server side sync, this method doesn’t seem to work (tested both on-prem and online). We ended up writing a simple custom workflow extension (using the SDK) to send the emails.

    Like

Plaats een reactie