Although custom fields can be added to the standard EmailMessage object, there does not seem to be any way to populate these fields when sending an Email using the Messaging.SingleEmailMessage class.

What would be the best way to do this? One way I can envisage is to create an Apex Trigger on the EmailMessage object which refers to an instance of a certain Apex Class that was initialized by the Class which called method Messaging.sendEmail() before the email(s) was(were) sent.

Would this actually work? (I haven't tried it yet) Or preferably, is there a simpler way to achieve this?


You must log in to answer this question.

Browse other questions tagged .