I am trying to send an email to a contact owner so I passed contact ownerID instead of contact ID, now the user is getting the emails as expected but the merge fields are not working as I am not passing contact Id anywhere.
Can someone please suggest if is there any way to send emails to contact owners only and simultaneously use contact merge fields.
Contact Cont = [SELECT Id, ownerID FROM Contact where name = 'Alan Johnson' LIMIT 1];
EmailTemplate ETemp = [SELECT ID FROM EmailTemplate WHERE name = 'ContactTemplate' Limit 1];
Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
email.targetobjectid = cont.ownerID;
email.setTemplateId(ETemp.id);
email.saveAsActivity = false;
Messaging.sendEmail(new List<Messaging.SingleEmailMessage>{email});