Configuring notifications for multiple internal companies

Dubz
Mega Sage

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

1 ACCEPTED SOLUTION

Actually, just read this:



5 Mail Script API

The following variables are available when processing mail_script scripts.


VariableObject Description
templateHandles printing from the mail script to the email message.

template.print("message"); //outputs message to the email body.
template.space("number of spaces"); //outputs spaces to the email body.


email_actionGlideRecord object for the email notification (sysevent_email_action).
eventGlideRecord object for the event that fired the notification (sysevent).
emailEmailOutbound object

Available methods:


  • addAddress(String type, String address, String displayname): type can be cc or bcc.
  • setFrom(String address): override the sender address.
  • setReplyTo(String address): override the reply to address.
  • setSubject(String subject): override the subject of the message.
  • setBody(String message): override the body of the message.

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!


View solution in original post

9 REPLIES 9

Gaurav Bajaj
Kilo Sage

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


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?


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.




find_real_file.png




find_real_file.png




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


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?