function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

HTML Email using Apex



Whenever I send an email using a HTML email template through apex, the email is not logged in HTML Email Status related list in COntacts and Leads. The email template I am using is HTML one.


Am I missing something small?




Are you setting setSaveAsActivity to false by any chance?

If you refer the Apex documentation you will find something called "HTML email tracking". Is it enabled for you Org?


Ya I figured it out right after posting the issue here.


Thanks though.

Bart BartlettBart Bartlett

I'm actually having a similar issue. 


We've created 2 HTML email templates to send to leads after leaving a voicemail or having a conversation via refractive dialer. Everything seems to work ok; the workflow automatically sends the correct email when the 'send email' custom field is changed in the lead page. However, we are having an issue seeing the HTML email logged. 


For some reason, in activity history, sending the email doesn't show up. We know the email was sent (atleast I think we do), but we can't see it in the log. I've tested everything; it works when I go in manually and change the lead status etc and it auto sends the lead an email. However, the tracking doesn't seem to be logging it. What am I missing, and am I missing a step?