- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Is there a way to create something that does the mailto, but instead of displaying a link, it displays a button? We have begun creating buttons in our notifications and now users want the "OK to close" and "OK to Retire", etc. links to display as buttons. I haven't seen anything that can do it, but I'm sure there is way.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
try this if it works
<!-- Replace the email address, subject, and body as needed -->
<a href="mailto:someone@example.com?subject=OK to Close&body=Please close this ticket."
style="display: inline-block; padding: 10px 20px; background-color: #28a745; color: #fff;
text-decoration: none; border-radius: 5px; font-weight: bold;">
OK to Close
</a>
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
try this if it works
<!-- Replace the email address, subject, and body as needed -->
<a href="mailto:someone@example.com?subject=OK to Close&body=Please close this ticket."
style="display: inline-block; padding: 10px 20px; background-color: #28a745; color: #fff;
text-decoration: none; border-radius: 5px; font-weight: bold;">
OK to Close
</a>
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi @cgedney ,
Please check below code I tried in my PDI it is working fine
<div style="text-align:center;">
<a href="mailto:someone@example.com?subject=OK%20to%20Close"
style="background-color:#28a745;
color:#fff;
padding:10px 20px;
text-decoration:none;
border-radius:4px;
margin-right:10px;
display:inline-block;">
OK to Close
</a>
<a href="mailto:someone@example.com?subject=OK%20to%20Retire"
style="background-color:#dc3545;
color:#fff;
padding:10px 20px;
text-decoration:none;
border-radius:4px;
display:inline-block;">
OK to Retire
</a>
</div>
Result:
Please mark my answer correct and helpful if this works for you
Thanks and Regards,
Sarthak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
ServiceNow – Creating Mailto or Action Buttons in Notifications
Goal
You want to show “OK to Close”, “OK to Retire”, etc. as buttons (not text links) in ServiceNow notification emails. You can’t use JS in emails, but you can style HTML <a> links to look like buttons.
---
1️⃣ Simple Mailto Button
------------------------
<a href="mailto:support@example.com?subject=OK%20to%20Close%20${number}&body=Ticket%20${number}%20is%20ok%20to%20close."
style="background:#0b5fff;color:#ffffff;text-decoration:none;
display:inline-block;padding:12px 18px;border-radius:6px;
font-family:Arial,Helvetica,sans-serif;font-size:14px;line-height:1.1;"
target="_blank">
✅ OK to Close
</a>
Notes:
- Encode spaces as %20.
- You can include dynamic fields: ${number}, ${short_description}, ${assigned_to}.
- Works in most clients (relies on local mail client).
---
2️⃣ Button Linking to ServiceNow Action (Recommended)
----------------------------------------------------
<a href="${gs.getProperty('glide.servlet.uri')}api/x_app/oneclick?token=${one_click_token}&action=close"
style="background:#17a673;color:#ffffff;text-decoration:none;
display:inline-block;padding:12px 18px;border-radius:6px;
font-family:Arial,Helvetica,sans-serif;font-size:14px;line-height:1.1;"
target="_blank">
✅ OK to Close
</a>
Explanation:
- Use tokenized links (via Scripted REST API or one-click approval endpoint).
- ${one_click_token} is generated server-side and validated for audit/logging.
- Perfect for “OK to Close”, “Approve”, “Reject” with tracked results.
---
3️⃣ Outlook-Friendly (Bulletproof) Button
----------------------------------------
<!--[if mso]>
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" href="MAILTO_OR_HTTP_URL" arcsize="8%" stroke="f" fillcolor="#0b5fff" style="height:40px;v-text-anchor:middle;width:200px;">
<w:anchorlock/>
<center style="color:#ffffff;font-family:Arial,Helvetica,sans-serif;font-size:14px;">✅ OK to Retire</center>
</v:roundrect>
<![endif]-->
<!--[if !mso]><!-- -->
<a href="MAILTO_OR_HTTP_URL"
style="background:#0b5fff;color:#ffffff;text-decoration:none;
display:inline-block;padding:12px 18px;border-radius:6px;
font-family:Arial,Helvetica,sans-serif;font-size:14px;">
✅ OK to Retire
</a>
<!--<![endif]-->
Use this if your users are on Outlook desktop—Word-based rendering breaks CSS buttons otherwise.
---
4️⃣ Tips for ServiceNow Notifications
-------------------------------------
- Use the “HTML” field in notification body.
- Inline all CSS; external or <style> tags are stripped.
- Add a text fallback for accessibility:
<p style="font-family:Arial,Helvetica,sans-serif;font-size:12px;color:#666;">
If the button doesn’t work, copy & paste this link:<br>
<a href="YOUR_URL_HERE" style="color:#0b5fff;">YOUR_URL_HERE</a>
</p>
- Prefer real action URLs over mailto for:
- Auditing (who clicked)
- Record updates (close, approve, retire)
- Mobile compatibility
---
✅ Summary
- There is no built-in “mailto button”, but you can style <a> links as buttons.
- For real workflow actions, use a tokenized HTTP URL back into ServiceNow.
- Use VML pattern for Outlook compatibility.
- Keep CSS inline and include plain text fallback.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Thanks everyone. I was trying to do it in the Email Template. I had to make an email script (because we have 3 instances, and I needed to correct the email address for each instance) and then use that in the notification. That seems to have done the trick.
