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
SFDC New learnerSFDC New learner 

how to use IF condition in email template

Hi All,

 I am trying to display the name in the user signature in the email template body.

Hi {!User.FirstName},

body

Regards,
{!if(User.FirstName = "XYZ","Team","null")}

If the user's first name is XYZ ,it should appear as

Regards ,
Team

else it should appear as

Regards,
XYZ

Please help me on this.

Thanks,
Sirisha
 
Raj VakatiRaj Vakati
Try this
 
{!if(User.FirstName="XYZ", "XYZ", "")}

 
AshishkAshishk
I think it should be
 
{!if(User.FirstName="XYZ", "TEAM", "XYZ")} 

or

 if you want to show First name as it is then

 {!if(User.FirstName="XYZ", "TEAM", User.FirstName)}




Hope this works.
SFDC New learnerSFDC New learner
Thanks Raj Vakati/Ashishk for the reply.

But it just shows blank when I try to Send Test and Verify Merge fields.
it is showing like this
Regards,
 
AshishkAshishk
Which formula you used? I tried {!if(User.FirstName="XYZ", "TEAM", User.FirstName)}, showing me correct value in "Send Test and Verify Merge fields"
SFDC New learnerSFDC New learner
I am using this one
{!if(User.FirstName = "XYZ","Team",User.FirstName)}
AshishkAshishk
Can you check access of user fields? from profile or permission set.
AshishkAshishk
Is it resolved? If so please close this.

Thanks
SFDC New learnerSFDC New learner
Hi Ashishk,
 
  Sorry for the delay.

I have copied and pasted using "Paste as Plain text(ctrl + shift + v)" ,it worked that way.But further I was trying to display "Support " in the next line like below it was showing blank.Please let me know if it is working for you or not.

Hi {!User.FirstName}


thanks

Regards,

{!if(User.FirstName= 'Sirisha', ' 'Team' & BR() & 'Support' ',User.FirstName)}

Thanks,
Sirisha
AshishkAshishk

Use this:-
{!if(User.FirstName= "Sirisha", "TEAM <BR> Support" ,User.FirstName)}