I'm facing an issue on email script on how to apply CSS on the hyperlink
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2023 07:25 AM
I'm facing an issue on email script on how to apply CSS on the hyperlink, On 51 line to 56 have applied CSS anchor tags but I'm unable to show the button as like shown in the attached notification we have Re-open incident button on notification if you can see we want exactly like that one should be added to the Re-open this Incident INC0019203 to this text can any one please help on this requirement. Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2023 07:30 AM
Hi @rajeshKongamudi ,
I'm assuming your HTML is something like this: <a href="${URI_REF}">Some Text Here</a>
if so, you can apply the color by using inline css style, for example:
<a href="${URI_REF}" style="color:red;">Some Text Here</a>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2023 07:40 AM
Hi @Community Alums Thanks for your reply,
But i'm not using href i have added the comments in the below lines on Bold text
template.print('</font></p>');
template.print('<p><font size="3" color="black" face="helvetica">');
template.print(gs.getMessage('If you want to reopen the incident from Outlook Please click on below link'));
template.print('<br>');
template.print('<a');
template.print('style="' + backgroundColor + border + color + fontSize + fontFamily + textDecoration + webKitBorder + mozBorder + display + padding);
template.print('">');
template.print('${mailto:mailto.reopen}'); // for this we need to add the style Like button this line refers to the(Re-open this Incident INC0019203) on notification if you can see the screen shot which i have attached
template.print('</a>');
template.print('</font></p>');
})(current, template, email, email_action, event);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2023 07:43 AM
This is the entire email script for your reference
(function runMailScript(current, template, email, email_action, event) {
var sysid = current.getValue('sys_id');
var link = gs.getProperty('glide.servlet.uri') + 'service_portal?id=ticket&table=' + current.sys_class_name + '&sys_id=' + current.sys_id;
//var link= gs.getProperty('glide.servlet.uri') + 'service_portal?id=ticket&table=incident&sys_id= '+sysid+'"';
if (email_action.name != "Incident Resolved") {
template.print('<p><font size="3" color="black" face="helvetica">');
template.print(gs.getMessage('We have set your incident to resolved. If you are not happy that this issue has been resolved please click the link within the next 7 days to set the ticket back to active.'));
template.print('<br><br>');
template.print(gs.getMessage('Resolution Notes - ${close_notes}'));
template.print('<br><br>');
template.print(gs.getMessage('If you want to reopen the incident from service portal Please click on below link'));
template.print('</font></p>');
}
else {
template.print('<p><font size="3" color="#808080" face="helvetica">');
template.print(gs.getMessage('If you feel the issue is not resolved, please click the following link and reopen your incident:'));
template.print('</font></p>');
}
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="' + link + '"');
template.print('style="' + backgroundColor + border + color + fontSize + fontFamily + textDecoration + webKitBorder + mozBorder + display + padding);
template.print('">');
template.print(gs.getMessage('Re-open the incident'));
template.print('</a>');
template.print('</font>');
template.print('<br><br>');
template.print('<p><font size="3" color="#808080" face="helvetica">');
template.print('</font></p>');
template.print('<p><font size="3" color="black" face="helvetica">');
template.print(gs.getMessage('If you want to reopen the incident from Outlook Please click on below link'));
template.print('<br>');
template.print('${mailto:mailto.reopen}');
template.print('</font></p>');
})(current, template, email, email_action, event);