Set the subject with a mail script on an email notification.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2020 10:37 AM
Hi All,
I have a requirement of setting up a value on the notification subject line with Capitalization.
Example: Case number Status Changed to [State]
When I am trying to fetch the value of the State field using ${state}, i am getting the field value which is stored in small, for example "idd". I need the value to be displayed as "Idd". How can i achieve this?
Appreciate your help on this.
Thanks in advance.
- Labels:
-
Notifications
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2020 03:36 PM
Hi, if you want to capitalise the first characture of a string you probably need soemthing like
var myString = 'test'
var myNewString = myString.charAt(0).toUpperCase() + myString.slice(1);
gs.info(myNewString);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2020 05:05 PM
To add to Tony's response, actually setting the subject would be something like:
email.setSubject(myNewString);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2020 06:23 PM
Use Below in email script
email.setSubject(“your subject goes here”);
Then call your email script in email body
${mail_script:name of mail script}
Please mark Correct & Helpful, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2020 02:04 AM
It is working for me. Thank you all.