- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2017 03:39 AM
Hi All,
My company is actually a group of operating companies, as such some entities within the group require their own branding on things like service portal and notifications. I'm dealing with notifications now and i'm wondering if there is a more elegant solution than just creating a load of duplicate notifications and just changing the logo and saying, send this one when the company is this or when this email address is contacted.
I'm thinking of a mail script that looks up the company related to the incident and says, 'you're company x therefore i will send the signature associated with company x and the from and reply to addresses will be those associated with company x'.
Has anyone else done anything similar to this? Any advice is welcome
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-15-2017 01:33 AM
Actually, just read this:
5 Mail Script API
The following variables are available when processing mail_script scripts.
Variable | Object Description |
---|---|
template | Handles printing from the mail script to the email message. template.print("message"); //outputs message to the email body. |
email_action | GlideRecord object for the email notification (sysevent_email_action). |
event | GlideRecord object for the event that fired the notification (sysevent). |
EmailOutbound object Available methods:
The email address that is passed by setFrom and setReplyTo needs to be in a valid form such as 'helpdesk@sn.com' or 'Display Name <helpdesk@sn.com>'. If the email address includes a 'Display Name', then that value overrides the instance's display name. |
Looks like setFrom and setReplyTo should fulfill my requirements!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-15-2017 01:33 AM
Actually, just read this:
5 Mail Script API
The following variables are available when processing mail_script scripts.
Variable | Object Description |
---|---|
template | Handles printing from the mail script to the email message. template.print("message"); //outputs message to the email body. |
email_action | GlideRecord object for the email notification (sysevent_email_action). |
event | GlideRecord object for the event that fired the notification (sysevent). |
EmailOutbound object Available methods:
The email address that is passed by setFrom and setReplyTo needs to be in a valid form such as 'helpdesk@sn.com' or 'Display Name <helpdesk@sn.com>'. If the email address includes a 'Display Name', then that value overrides the instance's display name. |
Looks like setFrom and setReplyTo should fulfill my requirements!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2018 10:43 AM
Hello,
Could you trigger a different notification based on service or service offering?
Thank you,
Claire
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-27-2018 12:39 AM
Hi Claire,
Yes, you can either generate different events in a business rule depending on the service or service offering on the form or you could build in some logic to a mail script to change the content of the email dynamically depending on the service or service offering.
Cheers
Dave

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-25-2019 11:29 AM
Hello,
Can you share the dynamic mail script that you created for this? I'm having a hard time writing out the logic of "If recipient's company = x, setFrom and setReplyTo = x"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-13-2019 09:13 AM
The logic would be something like below
var gr = new GlideRecord('core_company');
if(gr.get(gs.getUser().getCompanyID())){
if(gr.getValue('name') == 'insert company name here'){
email.setFrom('Displayname<email@address.com>');
email.setReplyTo('Displayname<email@address.com>');
}
}
If you have a lot of companies you need to do this for it would probably be worth storing the details on the company form so you don't have to hardset the from/reply to address.