- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2016 01:53 PM
I would like to make it so that I can assign custom headers and footers to email notifications. Ideally what I would like to do is add a reference field for the header and footer on the email notification form and then when the email gets sent it can attach the header and footer for me. What would be the best way to go about this? Is it even possible?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2016 09:30 AM
Figured this out. For anyone that is curious, this is how I did it:
- Created table for headers and footers
- Added header and footer reference fields to the email notification form
- Created a business rule in the sys_email table that runs before insert that did the following:
- Emails contain a reference to the record used to produce them(the instance field), so I used this to query the sysevent table.
- Query the sysevent table for the most recent event that refers to the same instance and then get the name of the event. You must filter out the user.view and glide.heartbeat events. (kind of sketchy if there are very high volumes of events, but it was the best I could think of)
- Use the event name to query the sysevent_email_action (email notification) table.
- Once you have the right notification record, you can use the header and footer reference fields to get their HTML.
- Add the header HTML to the beginning of the body. Add the footer HTML to the bottom of the body.
Caveats to this method:
- It assumes a 1:1 ratio of email events to notifications. So if you have more than one notification tied to an event, you will run into trouble.
- Won't work for emails that are sent when records are inserted or updated. Most emails I send are through events anyways so that didn't really matter to me. I added a UI Policy to hide the header and footer fields unless the email is sent by an event.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-02-2018 08:21 AM
Hey guys,
I've created a email notification for a survey. How could I add an interactive image/button to this email?
I want users to click on the image and be redirected to the survey instated of clicking on ${mail_script:asmt_assessment_instance_script_1}
How could I achieve that?
Thanks,
Paulina
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2016 09:30 AM
Figured this out. For anyone that is curious, this is how I did it:
- Created table for headers and footers
- Added header and footer reference fields to the email notification form
- Created a business rule in the sys_email table that runs before insert that did the following:
- Emails contain a reference to the record used to produce them(the instance field), so I used this to query the sysevent table.
- Query the sysevent table for the most recent event that refers to the same instance and then get the name of the event. You must filter out the user.view and glide.heartbeat events. (kind of sketchy if there are very high volumes of events, but it was the best I could think of)
- Use the event name to query the sysevent_email_action (email notification) table.
- Once you have the right notification record, you can use the header and footer reference fields to get their HTML.
- Add the header HTML to the beginning of the body. Add the footer HTML to the bottom of the body.
Caveats to this method:
- It assumes a 1:1 ratio of email events to notifications. So if you have more than one notification tied to an event, you will run into trouble.
- Won't work for emails that are sent when records are inserted or updated. Most emails I send are through events anyways so that didn't really matter to me. I added a UI Policy to hide the header and footer fields unless the email is sent by an event.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2016 09:33 AM
Thanks for sharing!