
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2018 09:54 AM
I need to add line breaks to the body of an email notification. When I navigate to the "sys_email" table and view the email. It is adding the line breaks correctly. However, when receiving the email in my inbox, it is not. Anybody know why and how to correct it? I am using a script to create the notification, see script below.
Screen Shot from sys_email table
Screen Shot of email received in inbox
Script
var sender = email.from;
var mail = new GlideRecord("sys_email");
mail.initialize();
mail.subject = 'Your Incident could Not be created';
mail.body = 'In an effort to protect your sensitive information, we were unable to process your email sent to the HMS Helpdesk. Please make sure any sensitive data like passwords and socials are not included in the email. You will also need to remove any references to passwords or socials such as (ssn, pw, password,…).' + '\n\n' + 'As always, you may also call the Helpdesk for immediate assistance at 855-554-6748.' + '\n\n' + 'Thank you,' + '\n\n' + 'HMS Helpdesk';
mail.user_id = sender;
mail.recipients = sender;
//mail.content_type = 'text/html';
mail.checkpoint = 0;
mail.mailbox = 'outbox';
mail.type = 'send-ready';
mail.weight = 50;
mail.insert();
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2018 09:57 AM
Try replacing "\n\n" with "<br /><br />". The body of the email is read as HTML.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2018 09:57 AM
Try replacing "\n\n" with "<br /><br />". The body of the email is read as HTML.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2018 10:14 AM
Thank you, that worked like a charm 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2024 03:55 AM
I have used the above for one of my requirement, it's working as expected. Thanks!