- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2024 05:22 PM
Hello,
I need to change the date format that is part of a notification so that it shows as MM/dd/yyyy. On the screen shot below, my script is making the notification show "Opened:" two times and then the date for the second one is formatted correctly, but one a new line instead of the same line. Can someone take a look at my script below and tell what I am missing here please?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2024 05:57 PM
Hi @Annette Kitzmil ,
I think in the notification body you would have written Opened: followed by email script.
I would suggest remove Opened either at notification body or in the email script as of template.print
Please mark correct if my response has solved your query.
Cheers,
Mohammed Basheer Ahmed.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2024 07:19 PM - edited 03-20-2024 08:08 PM
HI @Annette Kitzmil check in your email body do you have extra word opened By. You can use the below script directly,
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2024 05:41 PM
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
var cabdate = new GlideDateTime('current.opened_at');
var fd = new GlideDateTime(cabdate);
var dateToPrint = fd.getDate();
var get = dateToPrint.getByFormat('MM-dd-yyyy');
template.print(get);
template.print('<p>Opened:</p> ' + get);
})(current, template, email, email_action, event);
In notification body-------------
${mail_script:mailscriptname}
If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!
Thanks & Regards,
Sumanth Meda

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2024 05:57 PM
Hi @Annette Kitzmil ,
I think in the notification body you would have written Opened: followed by email script.
I would suggest remove Opened either at notification body or in the email script as of template.print
Please mark correct if my response has solved your query.
Cheers,
Mohammed Basheer Ahmed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2024 05:32 AM
Thank you, I did have the word Opened in the body of the notification. I thought I had removed it, bur I missed it apparently or didn't save it when i did remove it. Have a nice day.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2024 07:19 PM - edited 03-20-2024 08:08 PM
HI @Annette Kitzmil check in your email body do you have extra word opened By. You can use the below script directly,
Harish