+ Start a Discussion
Ahmed Ansari 13Ahmed Ansari 13 

Html email status(EmailMessage) record not created in production

i have sent Email Using the below code
Lead ld = [select id, email, lastname from lead where id=:'00Q0r000001y0d6'];
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        mail.setTemplateId('00X0r000000E7C9'); // Html Template Id
        mail.setTargetObjectId(ld.Id); //Lead id
        Messaging.sendEmail(new List<Messaging.SingleEmailMessage>{mail});

Ahmed Ansari
Hi Ahmed,

You can go through the following link it may helpful for you to create the status record. 


I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Sachin Arora