Email Notification cannot get the User Time Zone
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2014 05:30 AM
Hi,
When we receive the email notifications from service now including work notes in the body, it has shown the instance time zone and time and it does not fetch the users time zone with latest updated time in email.
Can any one please help on this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2015 01:16 PM
Does this work on Eureka? I'm trying to get email notifications to display a specific timezone, which is different from the system timezone. I would like this email to show the same timezone for all users who will receive it.
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2015 01:11 AM
I've not tried this with Eureka (I'm currently running Dublin). This will currently show the timezone for the user that creates the email notification.
<mail_script>
var user = gs.getUser();
var timeZone = String(user.getTZ()); // <---- You can change this line to get the user you wish to use the time zone for or you can use a hard coded time zone.e.g: 'US/Eastern'
TimeUtils.changeTimeZone(current, 'work_start', timeZone);
template.print('First Task Start Date: ' + current.work_start.getDisplayValue());
</mail_script>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2015 05:46 AM
This doesn't work. The email came through with that line being blank. I tried some variations of that same code and it is still showing the system time.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2015 05:47 AM
If you use current.start_date.getDisplayValue() // It can give what the date appers on the form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2015 05:52 AM
The problem here is that the form will show the system time, but I want it to show one specific timezone. We have not yet implemented Self Service, so all of our users have the system time set for their accounts. I would like to send an email out for an event and show the timezone of the event. The email will be going to people across the globe.