Generating email reply on clicking a link in the email

nehayadav
Kilo Contributor

Is it possible to click a link in the email sent to the user by ServiceNow, that generates the reply and the user just has to click send? I have a scenario where some action has to be performed based on user's reply and I want to force the reply instead of user typing it in. Also the ServiceNow instance I am using is internal to the company, will authentication be required if I go this route?

14 REPLIES 14

Ahh.. I got it.. it was a missing ). Thanks Doug it worked.


edwin_munoz
Mega Guru

Hello Neha,



Yes, you can do it. Here is how to do it:



1. 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;  


}




2. Create an email inbound action that perform the action you need.


Thanks Edwin. I was able to implement the solution using email templates but was facing issues with HTML tags being present in the message body. Your response helped a lot.


The email tempalate mailto:mailto.xxxxx is ideal


Add a second line onwards to the message and it appears as the body of the new message



find_real_file.png


Hi Edwin,



Thanks for your post.


Can I format the body of that email? I need some text on the next line and need to make some text bold and Italic.



Kind regards,


Sourabh Dhaygude