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
abhik dey 1abhik dey 1 

HTML Email Teamplate Issues SF

In the HTML email template I want to distinguish between internal and external user while sending any email. I tried using If loop and it worked for me but while I try to access certain merge fields values its not populating any results.

{!Receiving_User.Legacy_Username__c}  [Custom Field]

I know receiving user takes the value from the contact, if so then how come my {!Receiving_User.username} gets populated. Also , is their any other way to distinguis between this two types users .

Below is the If loop i used which worked fine but since the above merge fields is not providing any value, it is not helping me any further.

###### {!IF(Receiving_User.ContactId=="",'abc', "2")}.

Any help. I need this urgent !
Vivek DeshmaneVivek Deshmane
Please try belwo and let me know. 
{!IF(ISNULL(Relatedto.ContactId),'abc', "2")}.

Best Regards,
abhik dey 1abhik dey 1
I don't see relatedTo in the field type of the email template. Secondly I am not using VF template. I am using HTML template with letterhead. [image: Inline image 1]