How to change font family in Mail Script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2020 01:55 AM
Hi Community,
I'm using the reply, reply all and forward functions in record activity by adding the glide.ui16.emailStreamResponseActions to system properties. I noticed the time stamp "On 19/02/2020 11:15:48 GMT, 'XYZ' wrote:" is defaulting to font family other than in our client template and when you start a new reply above this is it also defaulting to Times New Roman.
I've played around adding a new template.print line to style this to Segoe UI without much luck and have tried some suggestions in other posts without any luck. Does anybody know what and where I need to add this in the below?
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
// This mail script is intended to be used by the response client templates and will only work as expected
// if called from a template with a content type of HTML. current represents the original sys_email record.
var uname = current.user;
if (current.type != 'received') {
var u = new GlideRecord('sys_user');
uname = current.sys_created_by;
if (u.get('user_name', uname))
uname = u.name.toString() + '<' + u.email.toString() + '>';
}
var cdate = new Date();
cdate.setTime(current.sys_created_on.getGlideObject().getNumericValue());
var usePlainTextResponseContent = gs.getProperty('glide.email_client.use_plain_text_response', 'false');
if ((usePlainTextResponseContent == 'true' && !current.body_text.isNil()) || current.body.isNil()) {
template.print("<strong>On " + cdate.toLocaleString() + ", '" + uname + "' wrote:\n\n<strong>");
// Process plain text to dislay in HTML email client
template.print(sn_notification.EmailResponse.getOriginalEmailTextContent(current.getUniqueValue()));
} else {
var gdt = new GlideDateTime(cdate);
var curr_date = gdt.getDisplayValue();
template.print("On " + curr_date + ", '" + uname + "' wrote:\n\n");
template.print("<blockquote>");
// Remove html, head, body and style tags
template.print(sn_notification.EmailResponse.getOriginalEmailHtml(current.getUniqueValue()));
template.print("</blockquote></div>");
}
})(current, template, email, email_action, event);
The second issue i have is that in the email client when I use one of these functions is it enlarging the the space (about 1.5) between new lines of text. Does anybody know how I can overcome this?
Thanks,
James
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2021 03:12 AM
Hi james,
How did you fix the spacing between text , can help please?
Basically we want remove spaces between text.
Thanks