- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
Adding a watermark in the subject takes an enviable position at the top of emails sent, backing its presence on the body and offering an alternative option to match with existing records.
I'll show you examples of:
- Mail Scripts to implement the email subject changes
- Appending the notification watermark into the subject
- Why would you append the watermark in the subject
Watermarks are relevant when working with incoming emails classified as reply by an algorithm. By default, the system generates a watermark label at the bottom of each notification email to allow matching incoming email to existing records. The watermark always includes "Ref:" and a customizable prefix (default MSG), followed by the auto-numbered identifier of the source record (such as incident, problem, or change request). For example, Ref:MSG3846157
You have the option on the email notifications to add or omit the watermarks. However, you do not have the choice to add it to the subject. That is the reason we will need to implement a mail script to add the watermark into the subject.
Mail Scripts to implement the subject changes
Mail scripts allow for business rule-like scripting within an outbound email message. With mail scripts, you can dynamically change the email output of your system based on different criteria. Mail scripts allow you to perform simple tasks, such as displaying incident data, and complex ones, such as making advanced database queries.
Create mail scripts in System Policy > Email > Notification Email Script
To make them run, then add a ${mail_script:script name} embedded script tag to the body of the email notification or template,replacing script name with the name of the script you created. This makes it easy to use the same scripts in multiple email notifications or templates.
We will be using the email properties to modify the subject of the notification.
Appending the notification watermark into the subject
To append the watermark into the subject of the notification, I created a new mail script.
Name = subject_watermark
addwatermarktosubject();
// This function will attach the watermark at the end of the subject
function addwatermarktosubject() {
var vsubject = [email.getSubject(), email.watermark ].join(' ');
email.setSubject(vsubject);
}
Then I created a notification with the following qualities:
Notification | ||
Name | = | test_subject |
Table | incident | |
Inserted | CHECKED | |
Updated | CHECKED | |
Users | ||
Subject | Any Subject | |
Message | Test ${mail_script:subject_watermark} |
When I make a change on the incident table, the result is a notification is triggered and the email subject has the watermark appended as intended.
Why would you append the watermark in the subject
There are several reasons you would like to make the watermark part of the subject. First, the system will first search the watermark on the subject. Second, watermarks on the body can be deleted without noticing them. Third, it makes watermark importance more evident for the customer. And finally, the text "Ref:" can be found on the body without being a real watermark.
There are a few cons, or negatives, about including a watermark in the email subject. Watermarks can not be hidden in the HTML body. It is also aesthetically not as pleasing as having the subject alone, without the watermark. It also makes the subject longer, which can be a turn off.
Adding the watermark on the subject provides flexibility when working with reply emails. It just requires creating a mail script that appends the watermark to the subject.
I tested this on Fuji with Chrome as browser.
More information on email watermarks see:
- Email Resources Page (KB0540674)
- Incoming email classified as reply to 'null' via watermark
- Two watermarks in incoming Email messages
- 3 steps to determine if and why the event processor is unable to start
- Diagnosing and remedying stuck event processes
- Docs: Additional email properties
- Docs: Available system properties
- Docs: Create an email notification
- Docs: Notification examples
- Docs: Notifications
- Docs: Scripting for email notifications
- Troubleshooting email notifications - Send to the Event Creator
- Troubleshooting Outbound Email (KB0521382)
- Troubleshooting stuck event process (KB0547784)
- Verifying the recipient has an email address (KB0528669)
- Verifying the recipient's email address is properly formatted (KB0528671)
- Speed up your email delivery by validating recipients
- My other blogs
- 6,245 Views
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.