- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2022 10:29 AM
I need to show the selected checkbox variables from a catalog item in an email notification.
I have created the email script as follows, but isn't showing anything in the notification.
What am I doing wrong?
The backend names of my checkbox variables are dynamics_crm, waterquote and repe_number.
Name of email script is: show_variables_dynamics_applications and it is against the requested item table.
(function runMailScript(current,template,email,email_action,event) {
if(current.variables.dynamics_crm==true){
template.print("Dynamics CRM," + ' ' );
}
if(current.variables.waterquote==true){
template.print("WaterQuote," + ' ');
}
if(current.variables.repe_number==true){
template.print("REPE number," + ' ');
}
template.print('</p>');
})(current, template, email, email_action, event);
Attached screenshot of notification and what it looks like, as well as the selections on the RITM.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2022 10:36 AM
I think you need quotes around the true for each if:
if(current.variables.dynamics_crm=='true'){
template.print("Dynamics CRM," + ' ' );
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2022 10:36 AM
I think you need quotes around the true for each if:
if(current.variables.dynamics_crm=='true'){
template.print("Dynamics CRM," + ' ' );
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2022 10:42 AM
I actually tried that as well but I get the same/blank result in the notification.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2022 01:44 PM
Thank you, this was correct. I determined that I had mistyped the name of the mail script within the notification itself, so it wasn't showing it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2022 09:22 AM
any other suggestions?