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
TriggerTrigger 

Is there any way to hide a merge field in a HTML email template in Salesforce?

I have created an apex class and email service that handles inbound emails and associates them to a record based on a match in the email subject. The idea is to mimic email to case functionality for my custom object and it is working fine except for one thing. The Apex class checks the subject line of the incoming email for a matching record in salesforce. If the receiver of the initial email deletes or alters the unique field in the subject before replying, then the email is not matched.

I would like to be able to either insert the field into the email Header/Footer or make the merge field Invisible so that it is not going to be deleted. 

Is it possible to hide a merge field in an email template sent from salesforce?
Himanshu ParasharHimanshu Parashar
Hi Graham,

I think that as this is HTML email template you can edit html version and put custom html which will now visible to user and inside your apex class you can extract data
 
<input type="hidden" value="{mergefield}" id="recordid"/>
Does this makes sense ?

Thanks,
Himanshu
Salesforce Certified Developer | Administrator | Service Cloud Consultant

P.S. If my answer helps you to solve your problem please mark it as best answer.