web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

Using SendEmailRequest in Bulk

(0) ShareShare
ReportReport
Posted on by 4

Hi,

We are using the XRM SDK to distribute emails to our customers.  Each email can be different so we using the Bulk Request Messages to push the created email records up into Dynamics - ExecuteMultipleRequest and ExecuteMultipleResponse.

I should not, we have about 50,000 emails to send out, hence the bulk API so we don't get push back from the API limits of Dynamics.

This works fine for creating the email in a Draft state but we cannot get the emails to "send" reliably once up there.  We have tried the following implementations;

  1. Created a workflow when new email records are created, their state is set to SENT and they are sent out.  This didn't work as what we saw happen was all the workflows going into a pending resource state because they are all trying to execute at the same time (so 900 emails created at around the same time by the bulk API then queues up 900 workflows which all block each other).
  2. I have tried submitting SendEmailRequest via the Bulk API, but this throws back errors at us about timeout states and the API not responding.

Here is the code I have for #2

SendEmailRequest sendEmailRequest = new SendEmailRequest
{
EmailId = draftEmail.Id,
TrackingToken = "",
IssueSend = false
};

bulkRequest.Requests.Add(sendEmailRequest);

bulkRequest = new ExecuteMultipleRequest()
{
Settings = new ExecuteMultipleSettings()
{
ContinueOnError = true,
ReturnResponses = false
},
Requests = new OrganizationRequestCollection()
};

It's pretty simple and straigthforward.

Any ideas on how to mark these emails as sent in the system and get them out of draft state?

This is a process we run at least once a month.

Thanks - Greg

I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 70 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 33 Most Valuable Professional

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans