Buttons in Email which update fields in my custom table

Mahmood Ahmad
Tera Contributor

Hi all, 
i have requirement, i need to send email to user, the email will contain two buttons, yes and no, if user click on yes or no there is a field in my custom table will be updated. How i can do it?

4 REPLIES 4

Saurav11
Kilo Patron
Kilo Patron

Hello,

 

Take a look at OOB notification on Incident table, you'll have a mailscript called take_me_to_incident.

 

Please mark my answer as correct based on Impact.

Mahmood Ahmad
Tera Contributor

i have created custom email notification in which i attach the link of article, for this i used flow designer, but i want to add buttons to the same email. 

 

Chandresh Tiwa2
Mega Guru

Hi @Mahmood Ahmad ,

 

1. Create two email templates "email.yes" & "email.no"

ChandreshTiwa2_0-1696522549240.png

ChandreshTiwa2_1-1696522570562.png

2. In your notification, add ${mailto:email.yes} & ${mailto:email.no} to click on both responses. 

3. Create two inbound actions to capture both responses. Below screenshot shows Yes response.

ChandreshTiwa2_2-1696522753197.png

Under Actions in inbound email action, select your field which has to be updated

ChandreshTiwa2_3-1696522836401.png

 

User will receive both links in email and after clicking any one, he/she has to send the email. And that should update your record.

 

Please mark my answer as correct or helpful, if it helped.

 

 

 

 

 

Nilesh Wahule
Tera Guru

Hi @Mahmood Ahmad ,

 

I can relate to your requirement where we want to take consent of user in the Yes or No buttons and it should update the necessary info into the ServiceNow.

 

But unfortunately there is no OOTB functionality for this. we do have something called as actionable Outlook items which will allow users to react from the email itself like approve/reject. But making your own action will require efforts and will be out of scope.

 

For more information - Outlook actionable messages

 

As a work around, I can suggest a solution which we implemented. you can create a static links which will create a new draft mail and then have a inbound action in system which works on the subject of email, e.g. as follows:

 

<a class="btn btn-danger btn-opt-out" role="button" href="mailto:your_instance@service-now.com?subject=Opting out of Survey&amp;body=Hi,%0DI have decided to opt out of the survey. Kindly remove me from the reminder list.%0D%0DNote: Pease don&rsquo;t modify/delete the subject of email. It is important to record your response.">Opt-out</a>

 

You can also dynamically pass the data in subject and body while sending notification as follows

 

<a class="btn btn-primary btn-accept" href="/nav_to.do?uri=%2Fassessment_take2.do%3Fsysparm_assessable_type=ff6a9e4547ac7d10890774ab716d4385%26sysparm_assessable_sysid=${sys_id}">Accept and Proceed</a>

 

Here I am passing the sys_id dynamically, you can pass any data such as the record sys Id which you want to update from custom table.

 

 

Please mark my answer as helpful/correct if it resolves your query.

---

Nilesh Wahule