07/31/2023 02:43 AM
Hello,
When it comes to notification email template for specific module such as in case of ARS, SoD or campaigns we have specific ternary operators in order to fetch the data which is processed during the specific action but when it comes to notification template in rules how can we call dynamic attribute such as username and their manager in these kind of templates?
Note: when we are creating an email template there is a help button which displays all the module and their methods. but how can we use these methods in an email template. What I mean is like for example: when I want to use one of the methods from Analytics module in an email template, how can I use it?
Thank You.
07/31/2023 02:50 AM
Hi @Diksha10
If I understand your question correctly, do you mean how to decide which binding variable to use in the email template?
07/31/2023 02:53 AM
Yes. Also based on which circumstance we would use which binding variable? Like whether these binding variables are global or has any scope of usage?
Thanks.
07/31/2023 03:02 AM
@Diksha10it depends based on your requirement and the use case. For example, if you're using the analytics module and if you want to send the email notification with a copy of the analytics data, you must use ${ANALYTICSDATA} binding variable.
Other sample use case, if you want to send an email to an end-user from the rules, then you should use ${user?.email}
First you need decide the trigger point for the email notification that helps you to pick the correct binding variable. Let me know if you have any further queries.
07/31/2023 03:14 AM
Thank you for the reply. I just have a small question. Let's say in one of the user update rule, I want to send a notification template to the manager of a newly created user notifying that he is added below him. In which case when we check the help section there are many binding variables which can be used to fetch the manager's email?
Thanks.
07/31/2023 03:51 AM
@Diksha10 in this case, you can use ${manager?.email}
07/31/2023 02:28 PM
Hi @Diksha10
Please check below document where each binding variable for all the modules are listed.
07/31/2023 09:25 PM
Use below code in email template body to find out available variables
${this.binding.variables.each {k,v -> println "$k = $v" + "<" + "br" + ">"}}