how add a button in email notification
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2021 06:47 PM
I am trying to send email when an approval is inserted for a non task table in a scoped app, I created a notification. How can I add a button to say "Agree to the conditions" which would work like approval and update approval state on the record?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2021 09:05 PM
Hi,
I think you need to update email notification body to include a button.
You may try adding <button href="mailto:mailto.approval">Approve</button>
Regards
Harshal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2021 09:50 PM
Hi samadam,
Check the link. you may get any help from this.
https://community.servicenow.com/community?id=community_question&sys_id=0836549a1b4100107a5933f2cd4bcbe1
Regards,
Megha

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2021 12:05 AM
Hi
Please follow below steps
1) Create an email notification script as below.
var link = gs.getProperty("instance_name") + "@service-now.com";
var mailLink = "mailto:" + link + "?subject=Re:Yes&body="+email.watermark;
template.print("<a href="+mailLink + ">Agree to the conditions</a>");
2) Use this email script in your notification created on sysapproval_approver table with condition as source table is your custom table
Add the email script in Message HTML field as below.
${mail_script:nameOfEmailScript}
3)Create a reply type of inbound email action as below
Use script as below.
var tableName = "yourCustomTableName";
if ( email.subject == "Re:Yes") {
current.state = "approved";
current.update();
}
var gr = new GlideRecord(tableName);
gr.get(current.document_id);
gr.u_state = "Approved";
gr.update();
Hope this helps.
Regards,
Ujjawal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2021 08:04 AM
Hi
If I helped you to resolve your query with my answer. Then I would really appreciate if you can mark my answer correct and helpful. So that it can be moved to answered list and helpful for future readers.
Regards,
Ujjawal