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
DJ 367DJ 367 

Email Template to display fields

Hello Everyone,

Can you someone please help me to complete this below code in email template. Thanks

{!NULLVALUE(Customer__c.ContactToSendNotification__c,+('Dear ' + Customer__c.Salutation__c +Customer__c.ContactToSendNotification__c+), Customer__c.Salutation__c + 'Dear Sir or Dear Madam'+)}
Note: Salutation__c is a formula field on customer object

I want is when ContactToSendNotification__c is not null then output should be Like "Dear Salutation NameOfCust," 
If ContactToSendNotification__c is blank then output should be like
"Salutation Dear sir or Dear Madam,"
 
Best Answer chosen by DJ 367
Sankeerth ReddySankeerth Reddy
This code works for me, displays as Dear {contact.first name} in the email template
{!if(Not(ISBLANK(Contact.Birthdate)), 'Dear ' + Contact.FirstName + Contact.LastName, "No Value Mate")}
make sure to check the commas and brackets
 

All Answers

Sankeerth ReddySankeerth Reddy
Hey DJ 367,

Try this
{!if(Not(ISBLANK(Customer__c.ContactToSendNotification__c)), 'Dear ' + Customer__c.Salutation__c + ' ' + Customer__c.ContactToSendNotification__c, Customer__c.Salutation__c + ' Dear Sir or Dear Madam')}

 
DJ 367DJ 367
Hi,
it is not working. Value is getting displayed but captions like 'dear' is missing. thanks
Sankeerth ReddySankeerth Reddy
This code works for me, displays as Dear {contact.first name} in the email template
{!if(Not(ISBLANK(Contact.Birthdate)), 'Dear ' + Contact.FirstName + Contact.LastName, "No Value Mate")}
make sure to check the commas and brackets
 
This was selected as the best answer
mukesh guptamukesh gupta
Hi,

Please check below tested code!
 
{!IF(NOT(ISBLANK(Customer__c.ContactToSendNotification__c,('Dear ' + Customer__c.Salutation__c +Customer__c.ContactToSendNotification__c+), Customer__c.Salutation__c + 'Dear Sir or Dear Madam')))}

if you need any assistanse, Please let me know!!

Kindly mark my solution as the best answer if it helps you.

Thanks
Mukesh