- 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-07-2017 03:41 AM
Hi,
You can achieve it with a Business rule on the sys_email table to add signature based on the company. A lookup table for company and logo would make it better.
and then you can add the custom signature in the email body.
Please mark correct/helpful based on the impact of the response.
Thanks
Gaurav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2017 03:48 AM
Hi Gaurav,
Thanks for that,.
So, i create a custom table linking a company record with a mail script containing their bespoke signature and then the BR populates the notification with the appropriate mail script depending on the company on the ticket? How would i be able to define the positioning of the mail script on the notification body? Would i also be able to set the from and reply to addresses in the same rule?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2017 04:06 AM
So, i create a custom table linking a company record with a mail script containing their bespoke signature and then the BR populates the notification with the appropriate mail script depending on the company on the ticket?
You can use email template table as your custom table here, just define the message HTML part with all the CSS you need.(use the rich text editor to define it).
How would i be able to define the positioning of the mail script on the notification body?
You can add a placeholder to the email template and then replace it with signature in the BR itself.
Would i also be able to set the from and reply to addresses in the same rule?
You can update the user and reply to field in same BR(before insert)
See the below screenshot for help.
PS: This will be beneficial if you want to place everything in one BR else notification email script can also perform the same action.
Thanks
Gaurav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-15-2017 12:51 AM
Hi Gaurav,
Thanks for the response on this. I'm actually doing this in the notifications table; sysevent_email_action. When tickets are opened i need the ticket opened for me notification to be branded according to the company and the from and reply to addresses to be the ones associated with that company. Likewise for all other incident updated/resolved/closed notifications.
If i do a BR on this table it is only going to fire when a new notification record is inserted or updated right? Not when a specific instance of a notification is generated.
I'm sure i could account for sending a different signature depending on the internal company but i have no idea how to modify the from and reply to addresses dynamically. Do you know if these fields on the notification form will take javascript?