Template:
<!DOCTYPE html>
<html>
<body>
<p><b>{!Contact.FirstName},</b><br>
<p>Please follow: <a href="https://www.google.com/">John Smith</a><p>
</body>
</html>
Apex:
EmailTemplate template = [SELECT Name,Body,DeveloperName,HtmlValue,Subject FROM EmailTemplate WHERE DeveloperName ='GuestMail'];
for(Contact c : scope){
Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
email.setTemplateId(template.Id);
email.setTargetObjectId(c.Id);
Messaging.SendEmailResult[] responseList = Messaging.sendEmail(new Messaging.SingleEmailMessage[]{email});
if(responseList[0].isSuccess()){
Contact con = new Contact();
con.Id = c.Id;
con.Status__c = c.Status__c;
con.Status_Time__c = c.Status_Time__c;
contactListToUpdate.add(con);
}
Output:
Let me know where am I going wrong. Thanks!