How to add mail script to email template

steveturley1
Kilo Contributor

Hi.

I suspect this may be super simple.

I'd like to test the mail script '${mail_script:requested_items_summary_with_options}'

However, I'd like it to be part of or in addition to the email template 'request.itil.approve.role'

What would be the best way to do this?

Thanks!

 

 

 

1 ACCEPTED SOLUTION

Get your code in a fix script and debug there, it's much easier. If this question is answered please mark an answer correct to close it down

View solution in original post

7 REPLIES 7

It looks like when you copied in the mail script it's formatted it as a link. I've had issues with that before, you might have to delete it and write it in manually. It's a bit annoying but i don't think it gets recognised as a mail script when it has been added as a hyper link.

Also, i'm not sure if removing the runMailScript function will have affected things at all. If reformatting the mail script call doesn't work it's worth testing with your code within that function.

(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {

//your code

})(current, template, email, email_action, event);

Haven't really checked your script, if the above doesn't work it's always worth chucking it in a fix script and logging out the results to make sure it's all working properly.

 

I think that formatting was the issue. The notification is sending with the mail script line in.

My next issue is why that mail script isn't returning any information!

Thanks for your help

Get your code in a fix script and debug there, it's much easier. If this question is answered please mark an answer correct to close it down