1

I'm writing custom workflow in Dynamics CRM. Has anybody used SendBulkMailRequest Class? This class we used for sending bulk mail to the contacts and the scenario is like, sending a bulk mail and later update the field in other entity for every successful mails sent.

Here is the reference link of the class. Suggestions are appreciated.

NaveenGNK
  • 93
  • 3
  • 12
  • What’s your question? Have you tried & facing issues? – Arun Vinoth-Precog Tech - MVP Nov 27 '17 at 16:44
  • Thank you @ArunVinoth. I tried the code, The bulk mails are going fine. The issue is, for every successful mail sent, I want to update a field in another entity. we have a field called (IsMailSent-->bool) in opportunity entity. I want to update this fields to true if the mail is sent success, Otherwise it should be false. SendBulkMailResponse resp = (SendBulkMailResponse) _serviceProxy.Execute(bulkMailRequest); This code send mails to all contacts. How can I update that flag for successful mail sent records. – NaveenGNK Nov 27 '17 at 16:54

1 Answers1

0

You are sending Bulk Emails to Contacts, then you are tracking the Email sent flag in Opportunity record. I assume you are having a way to find out the right opportunity to update from the contact in Email recipient. (Just curious - What are you setting as regarding of those Emails?)

My recommendation: Register a plugin on Email create, then retrieve the contact's opportunity, set the flag IsMailSent to true & do a Service.Update(Oppty)

I guess SendBulkMailRequest message is just like broadcaster, as I noticed the below comments inside code sample.

// When the bulk email operation has completed, all sent emails will
// have a status of "Pending Send" and will be picked up by your email
// router. Alternatively, you can then use BackgroundSendEmail to download
// all the emails created with the SendBulkEmail message.
// See the BackgroundSendEmail sample for an example.