Is there any way to easily retrieve the Id of EmailMessage records after sending them via Messaging.SendEmail()?
Messaging.SingleEmailMessage m = new Messaging.SingleEmailMessage();
m.setToAddresses( new String[]{'heim@elastify.eu'} );
m.setSubject( 'test' );
m.setHtmlBody( '...' );
Messaging.sendEmail(new Messaging.SingleEmailMessage[] { m });
Now how can I get the Id(s) of EmailMessage(s) generated as a result of the sending?
getErrors()
andisSuccess()
only. – Santanu Boral Jul 11 '18 at 12:06