I'm writing plugin C#, to send an email to the users who are under SystemCustomizer role notifying that Contact is creating or Updating.
How to send an email to multiple users (Bulkmailing/ forEach loop for creating mail request to every user)?
I'm writing plugin C#, to send an email to the users who are under SystemCustomizer role notifying that Contact is creating or Updating.
How to send an email to multiple users (Bulkmailing/ forEach loop for creating mail request to every user)?
Use a query to find each system user entity with the system customiser role.
Then for each user send an email. 1; create the email, 2; send the email.
// Create an e-mail message.
Email email = new Email
{
To = new ActivityParty[] { toParty },
From = new ActivityParty[] { fromParty },
Subject = "SDK Sample e-mail",
Description = "SDK Sample for SendEmail Message.",
DirectionCode = true
};
_emailId = _serviceProxy.Create(email);
// Use the SendEmail message to send an e-mail message.
SendEmailRequest sendEmailreq = new SendEmailRequest
{
EmailId = _emailId,
TrackingToken = "",
IssueSend = true
};
SendEmailResponse sendEmailresp = (SendEmailResponse)_serviceProxy.Execute(sendEmailreq);