- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2019 10:24 AM
Hello,
Is there a way to add a banner image to all outbound emails, without having to add it manually to each email notification?
Thanks,
Laurie
Solved! Go to Solution.
- Labels:
-
Notifications
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2019 09:37 AM
You can use a Before Insert/Update Business Rule to accomplish that:
The Script would be:
(function executeRule(current, previous) {
//add a note to the top of the message with a customizable Message record
var prefixMessage = gs.getMessage("u_notification_prefix").replace("u_notification_prefix", "");
//update the current email message
current.body = prefixMessage + current.getValue("body");
})(current, previous);
I actually use a Message record to control the contents of the prefix:
The Message field can contain whatever HTML you might need. You can also just put it into the Business Rule if you would rather keep everything together. I use the Message record because I have a prefix and suffix and a few other things in the Business Rule. I just included a simplified version of the BR above.
So that BR will now include the prefix into every single email that goes out of your instance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2019 10:47 AM
We can try something like a background script.
Create a notification email script.
Loop thru email notifications and include the email notification script at the end?
Proceed with caution, untested.
var noti = new GlideRecord('sysevent_email_action');
noti.query();
while (noti.next()) {
var gr = new GlideRecord('sys_script_email');
gr.addQuery('sys_id', 'Newly created notification script');
gr.query();
if(gr.next()){
noti.message_html = noti.message_html+'\n'+'${mail_script:'+gr.name+'}';
noti.setWorkFlow(false);
noti.autoSysFields(false);
noti.update();
}
}
Please mark my response as correct and helpful if it helped solved your question.
-Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2019 12:14 PM
I was hoping there was a property oob, or something I was missing!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2019 12:21 PM
I wish there would be an easy way.
Lets see if someone else has any idea
Please mark my response as correct and helpful if it helped solved your question.
-Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2019 06:10 AM
Thank you.