Thank you for your feedback.
Form temporarily unavailable. Please try again or contact docfeedback@servicenow.com to submit your comments.
Versions
  • London
  • Kingston
  • Jakarta
  • Istanbul
  • Helsinki
  • Geneva
  • Store
Close

Line breaks in email notifications and rich HTML

Line breaks in email notifications and rich HTML

Rich HTML provides additional control over line breaks in your email notifications and templates.

To provide control over line breaks, a Newlines to HTML check box is available in the Email Script form.
Figure 1. Newlines to HTML option

Selecting the Newlines to HTML check box indicates that the method for handling line breaks in earlier versions carries forward for email notifications and templates. When an email notification or template is converted to rich HTML, the Newlines to HTML check box is automatically selected.

For new mail scripts, add correct HTML line breaks to template.print() statements.

If an email notification or template is not converted to rich HTML, newlines are automatically wrapped with <div> tags, the same as previous versions. The old mail scripts still work. However, the administrator does not enjoy the benefits of working in the rich HTML format, and does not have as much control over exact HTML formatting.

HTML line breaks in new scripts

When writing new scripts, insert explicit HTML line breaks and clear the Newlines to HTML check box so that no HTML tags are injected when email notifications are generated. For existing notifications and templates, replace template.print("\n") JavaScript function calls with template.print("<br />"). This replacement gives you better control over the HTML formatting of your email notifications.