Monday, Sep 06, 2010
Login

Posts Tagged ‘mail_script’

Email links using ${URI} and ${URI_REF}

I learned something new today while building out a few email notifications. If you’ve been around Service-now for a while
you’re probably familiar with the formatting of email notification messages. One of the common requirements for outgoing email notifications is to include a link to the originating record or task in the email. Doing this makes it easy for end users to return to the record that they need to work on. There are a couple of simple ways to include these links in the body of an email notification in Service-now. One way I’ve known about for a long time, the other way I just discovered.


Send an Email Notification with Associated Attachments

I

t’s very common to send out an email notification at different stages of a task. There are great example notifications out-of-box in the Service-now platform that show you how to set these up. In some cases, you may wish to send more than the standard information in your email. The ‘mail_script’ tag can be used to do some more advanced script processing and then print out the results using the ‘template.print’ command. Here’s a sample script that you could use in an outbound email notification. The sample script is designed to send out information about a particular task. It also includes a ‘mail_script’ function to perform some advanced processing and include links to all of the associated attachments for the task. This script can be pasted directly into the ‘Message’ field on an email notification or email template record.


 

Recent Comments

  • Scott Stechmesser: Awesome script to use. Works great. How would you modify it to be able to copy a Catalog UI Policy?
  • Tulio: Perfect!!! Thanks for this.
  • Ron Methias: Another reason why I have stopped going to the official SN documentation sites and make the GURU my...
  • Richard Huss: Ingenious – and somewhat simpler than the way the Incident Resolution best practice plugin does...
  • valor: Joe, that’s one of the reasons why I’m parsing out the URL instead of trying to get the page...