Email Notification hyperlink for outbound email

sr_surendra
Giga Expert

Hello All,

I wanted to ask question about Hyperlinks which we can create in Email Notification.

I Wanted to create a hyperlink in an email notification which should be trigger in a catalog item after fulfillment of certain condition with wording something like-

"request (RITM No.) For termination is completed ensure that map indicating where user are located on campus is properly updated please {Hyperlink"reply to this email"} once you have updated asset map in a location".

In this mail as shown in Bold, should be one hyperlink , on clicking which mail like {Request for asset update in location ****** has been completed successfully} should trigger as reply to mail which was perviously triggered (to instance's mail id)

4 REPLIES 4

vab_13
ServiceNow Employee
ServiceNow Employee

Hello Vab,



Thanks for reply.


Is there any way we can create custom email, which will trigger by clicking this hyperlink?


which should be as reply to original mail (mail triggered through email notification containing hyperlink)



Thanks


vab_13
ServiceNow Employee
ServiceNow Employee

Hi Surendra



Possible via a couple of ways:




==============


1. Write a script similar to the below



Click here


<mail_script>


template.print("<a href='mailto:[your instances email address]?subject=Re:${sysapproval}%20-%20unsatisfied&body=${watermark}'> Click here if your issue was not properly resolved ${sysapproval}</a>");


</mail_script>



==============


2. Add on your email notification a link that will generate the reply. Example of email script to create link:


  • var subject = 'RE:' + current.number + '- Your subject here';      
  • var body = "Your body text here" + email.watermark;      
  • var text = 'here';    
  • template.print("Click" + generateLink(subject, body, text) ;      
  • function generateLink(subject, body, text){      
  •       var linkStart = '<a href="mailto:' + gs.getProperty("glide.email.user") +'?subject=' + subject + '&body=' + body + '">';        
  •       var linkText= text;      
  •       var linkEnd ='</a>';      
  •       return linkStart + linkText + linkEnd;      


Create an email inbound action that performs the action you need.



==============



3. The email template mailto:mailto.xxxxx can do the deed as well.



==============



Useful Reads:



Scripting for email notifications


JavaScript in emails


Mail script API


Example scripting for email notifications




HTH


sr_surendra
Giga Expert

Is there any way we can create custom email, which will trigger by clicking this hyperlink?


which should be as reply to original mail (mail triggered through email notification containing hyperlink)