You need to sign in to do that
Don't have an account?
SatyaPrusty
MassEmail to Users
My requirement is to send emails to multiple users. My apex works for contact and Lead object, but not for user object.sendEmail method executed successfully, but users are not reveing mails. Can anyone help why it is working for Contact/Lead but not for user
I am also facing the same issue. This particular problem is happening only for user objects in case of Massemail. I am pasting the required code.
{
Messaging.MassEmailMessage mail = new Messaging.MassEmailMessage();
List<Id> userids = new List<Id> ();
userids.add('0053000000102UqAAI); // for userid
mail.setTargetObjectIds(userids); mail.setTemplateId('00XQ0000000HvBNMA0');mail.setSaveAsActivity(false);
Messaging.SendEmailResult[] sendEmailResults = Messaging.sendEmail(new Messaging.MassEmailMessage[] { mail });for (Messaging.SendEmailResult sendEmailResult : sendEmailResults) {
if(sendEmailResult.isSuccess()){ System.debug('success');}
else{ System.debug(
'error');}
}
}
The message is showing as success but actually I am not receving any email. But the same code base is working perfectly and I am receiving the email ( for same email address), if I am considering Leda/ Contact instead of user object. As per Massemail rule it should work fine for Lead, User and Contact objects.
Can anyone help me on this.
Hey guys,
No answers? any updates? is it a bug from SF??
thanks