You need to sign in to do that
Don't have an account?
Joe Andolina 7
MassEmailMessages and the TargetObjectIds and WhatIds values
Hey All,
My app is working sending lots of SingleEmailMessage from a loop. I was thinking it would be cool to use a MassEmailMessage instead.
In the lists sent to setTargetObjectIds and setWhatIds, do they correspond to each other? If the lists are the same length, does the TargetObjectId need to map to the WhatId at the same index?
Thanks
My app is working sending lots of SingleEmailMessage from a loop. I was thinking it would be cool to use a MassEmailMessage instead.
In the lists sent to setTargetObjectIds and setWhatIds, do they correspond to each other? If the lists are the same length, does the TargetObjectId need to map to the WhatId at the same index?
Thanks
MassEmailMessage can send mails related to multiple records (WhatId and TargetObjectId). setTargetObjectIds method of MassEmailMessage can accept an Array of ID for contact, lead and user id's.
Check below references:
https://salesforce.stackexchange.com/questions/5169/whats-the-advantage-of-using-massemailmessage-instead-of-multiple-singleemailme
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_email_outbound_mass.htm
https://help.salesforce.com/articleView?id=email_mass_notes.htm&type=5
Limitations:
https://help.salesforce.com/articleView?id=limitations_email_mass.htm&type=5
Thanks,