
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2014 05:31 PM
In the notification of our change request, the OOB code includes this:
----------------------------------------
<hr/>
${mailto:mailto.approval}.
<hr/>
${mailto:mailto.rejection}
<hr/>
----------------------------------------
When the recipient receives the email and clicks on either the approval or rejection link, it opens a reply and assigns the to value to be the value of the this system property: glide.email.user
Unfortunately, that value for our set up does not have the domain and could not have the domain name because of the complications of our internal email system. The value for our test instance is ubcuit-a-ubctest. To get this to work, that value should be ubcuit-a-ubctest@mail.ubc.ca However, changing that property will not make our email work. Again, due to complications of our internal email setup not owning the domain. So going that route will definitely not work for us.
I was hoping to know how I can change the behavior of the two links such that instead of using the system property, "glide.email.user", it should use another one. I was thinking of creating a new system property and assigning the value "ubcuit-a-ubctest@mail.ubc.ca" to it and have the two links use this instead.
Does anyone know where and how I can change this? Any help is greatly appreciated.
Thank you very much!
Monette
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2014 11:19 AM
That does not work because the sys_watermark record does not exist yet. However, you can use "email.watermark" in a mail_script block to get the number - Re: Retrieve Watermark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2014 08:50 PM
I think your best bet would be a Before Insert/Update Business Rule on the Email table (sys_email) to replace "ubcuit-a-ubctest" with the full email address:
Condition: current.target_table == 'sysapproval_approver' && current.body.changes()
Script:
(function() {
current.body = current.getValue("body").replace(/ubcuit-a-ubctest/gi, "ubcuit-a-ubctest@mail.ubc.ca")
})();
You may have to tweak the conditions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2014 12:41 AM
The ${mailto:mailto.approval} is just a reference to another template that inserts a anchor tag into the email, its really just a matter of convenience so you can remove it and add your own tag, something like the below should work:
<hr/>
<a href="mailto:ubcuit-a-ubctest@mail.ubc.ca?subject=Re:${sysapproval} - approve">Click here to approve ${sysapproval}</a>
<hr/>
<a href="mailto:ubcuit-a-ubctest@mail.ubc.ca?subject=Re:${sysapproval} - reject">Click here to reject ${sysapproval}</a>
<hr/>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2014 07:59 AM
Unfortunately that will not work - the reply back to ServiceNow requires the watermark from the original approval email in order to properly approve or reject the request. Otherwise the task record (Change, Request, etc...) is simply updated with the text of the email.
That's why I think the simplest way to do it is with the Business Rule.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2014 08:40 AM
Just add the watermark into the mailto tags then:
<mail_script>
var watermark = '';
var wm = new GlideRecord('sys_watermark');
wm.addQuery('source_id', current.sys_id);
wm.query();
while (wm.next()) {
watermark ='Ref:' + wm.number;
}
<mail_script>
<hr/>
<a href="mailto:ubcuit-a-ubctest@mail.ubc.ca?subject=Re:${sysapproval} - approve&body=<mail_script>template.print(watermark);</mail_script>">Click here to approve ${sysapproval}</a>
<hr/>
<a href="mailto:ubcuit-a-ubctest@mail.ubc.ca?subject=Re:${sysapproval} - reject&body=<mail_script>template.print(watermark);</mail_script>">Click here to reject ${sysapproval}</a>
<hr/>