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
Static DevStatic Dev 

Send email alerts content based on a some condition

Hi All,
Could some one please guide me on this, I need help on how to send an email alert checking on record types.
i.e. i have RT = A n RT =B defined in my WF rule. And one email alert to be sent out which is a general email template.

But there is a need where some condidtion should be met in template so that some content of veribage in email should be only sent to party A, and some content should be sent to party B. Neither parties should recieve each other contents.

There is some minor difference in the veribage that both parties should be getting it.
Please help me how to achieve using merge fields. Also if i am not clear on anything.

Thanks a lot in advance.
Naval Sharma4Naval Sharma4
Hi Dev,

You can use IF condition in Custom email template and based on the record type you can form your content.

Thanks,
Naval
AG_SFDCAG_SFDC
Hello,

For verbiage in the template you can add conditions in the email template itself, In the visual force email template you can use something like this:
 
{!IF(RT='A', 'SHOW SOMETHING RELATED TO A','')}
{!IF(RT='B', 'SHOW SOMETHING RELATED TO B','')}

You can add fields also in the condition.

Similarly you can add condition to check for record type in the workflow rule.

Let me know if this helped you!

Thanks,
AG






 
AG_SFDCAG_SFDC
Hello,

You can use text email template also, you can use merge fields to get the record type.

Thanks,
AG
 
AG_SFDCAG_SFDC
Hi,

Try as follows:
 For example on contact object:

{!IF(Contact.RecordTypeId='Recorttype Id of A', 'SHOW SOMETHING RELATED TO A','')} {!IF(Contact.RecordTypeId='Recorttype Id of B',Contact.LastName ,'')}

let me know if it works!

Thanks,
AG
AG_SFDCAG_SFDC
Hi,

Select the merge fields as shown in the screen shot:

For example on Account:

User-added image

Thanks,
AG