
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2024 05:55 PM
So I am creating a mail notification that is generated from a RITM, it has some standard text, some variable values and that is all working fine.
The part I'm having issues with is where our users have chosen yes or no to a list of questions - I want to show all the questions they have answered yes to.
Please Note: This is not a standard yes no field, we have used multiple choice for formatting reasons, so it's not true false, it is yes or no as the answer.
I figured the best way would be a mail script, but I'm getting an error in the notification advising that:
"Email script render error: email script [ variables_yes ] does not exist"
If someone knows how I can do this I'd really appreciate the help please.
The email script I'm trying is like this:
(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */
email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */
event) {
if (current.variables.question1 == 'yes') {
template.print('*Are you going to attend?');
}
if (current.variables.question2 == 'yes') {
template.print('*Is the sky blue?');
}
if (current.variables.question3 == 'yes') {
template.print('*Do you like to swim?');
}
if (current.variables.question4 == 'yes') {
template.print('*Are you doing something on the weekend?');
}
})(current, template, email, email_action, event);
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2024 06:29 PM
Hi @Bidduam
Can you share the screenshot of your notification body?
How are you testing the notifications?
The format looks alright.
Aman Kumar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2024 06:29 PM
Hi @Bidduam
Can you share the screenshot of your notification body?
How are you testing the notifications?
The format looks alright.
Aman Kumar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2024 06:38 PM
I'm testing just by clicking on preview - works fine for all other parts and I've tried other known working mail scripts and they show fine, without any errors.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2024 06:46 PM
the name of the mail script is correct, right?
Can you check the source script of the email body by clicking on <> option in the toolbar and validate if everything looks alright there.
Aman Kumar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2024 07:34 PM
Yes it's named correctly - I copied and pasted it directly from the mail script title.
There is nothing in the html code that looks wrong:
<p style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;"> </p>
<ul style="margin-top: 0cm; margin-bottom: 0cm; list-style-position: inside;" type="disc">
<li style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;">comply with the</li>
</ul>
<p>${mail_script:variables_yes}<br /><br /></p>
<p style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;"> </p>
<p style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;"> </p>
<ul style="margin-top: 0cm; margin-bottom: 0cm; list-style-position: inside;" type="disc">
<li style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;">complete a ‘new