How to create a button in email
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2017 03:09 AM
How to create a button in email,
I am able to create a link but can anyone please let me know how to create a button instead of link
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2017 03:14 AM
Hi Shaik,
You can have a look of how it's done in one of the out of the box notifications:
Regards
Greg
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2017 03:35 AM
Greg thanks for the reply.
I already gone through the OOB Take me to the incident example, problem i am getting my link which redirects through inbound email action whenever user clicks the link from email body incident gets reopen now idk how to change it as button since i am trying with the same example of take to my incident it is redircting to the incident but its not reopening the incident
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2017 03:41 AM
Here is the code which i copied & updated from OOB take to the incident:
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
// Add your code here
var link = current.getLink();
var links = ('<a href="mailto:dev29848@service-now.com' + '?subject=Re: please reopen the incident'+current.number+' &body= hello ' + '">'+ ' </a>');
template.print('<font face="helvetica">');
var backgroundColor = 'background-color: #278efc;';
var border = 'border: 1px solid #0368d4;';
var color = 'color: #ffffff;';
var fontSize = 'font-size: 16px;';
var fontFamily = 'font-family: Helvetica, Arial, sans-serif;';
var textDecoration = 'text-decoration: none; border-radius: 3px;';
var webKitBorder = '-webkit-border-radius: 3px;';
var mozBorder = '-moz-border-radius: 3px;';
var display = 'display: inline-block;';
var padding = 'padding: 5px;';
// if (email_action.name == "Incident Survey") {
// color = 'color: #343d47;';
// backgroundColor = 'background-color: #e6e8ea;';
// border = 'border: 1px solid #bdc0c4;';
// }
template.print('<a href="' + links + '"');
//template.print('<a href="mailto:dev29848@service-now.com' + '?subject=Re: please reopen the incident'+current.number+' &body= hello ' + email.watermark + '">'+ ' </a>');
template.print('style="' + backgroundColor + border + color + fontSize + fontFamily + textDecoration + webKitBorder + mozBorder + display + padding);
template.print('">');
template.print(gs.getMessage('Take me to the Incident'));
template.print('</a>');
template.print('</font>');
template.print('<br><br>');
template.print('<p><font size="3" color="#808080" face="helvetica">');
template.print('Thank you.');
template.print('</font></p>');
})(current, template, email, email_action, event);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2017 04:11 AM
Hi Shaik,
Have you checked what information you getting in your inbound action?
Also look at these two lines:
var links = ('<a href="mailto:dev29848@service-now.com' + '?subject=Re: please reopen the incident'+current.number+' &body= hello ' + '">'+ ' </a>');
template.print('<a href="' + links + '"');
You're printing href in href that most likely messes up things as well.
Regards
Greg