- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2022 07:04 AM
Hi there,
I'm using email script, (a part) shown here below, to print the last given "Additional Comment" within a Incident, in an system notification (email).
template.print('<p><span style="color: #ffffff; font-family: trebuchet ms, geneva; font-size: 10pt;"><strong>');
template.print(journalEntry.value);
template.print('</strong></span></p>');
This works so far, so good. The only problem that no blank lines/paragraphs are shown in the generated email. All text is strung together.
How can I solve this problem. I've already tried something as here below, but unfortunately, that does not work. There must be an solution for this problem.
template.print('<p><span style="color: #ffffff; font-family: trebuchet ms, geneva; font-size: 10pt; p {margin-bottom: 10pt;}"><strong>');
template.print(journalEntry.value);
template.print('</strong></span></p>');
What I get:
What I want:
Any solution would be appreciated! Thanks!
Solved! Go to Solution.
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2022 07:41 AM
Use the global setting. Something like:
journalEntry.value.replace(/\n/gm, "<br/>")
P.S. or /\\n/gm, "<br/>" as regex expression (cant test it atm, sorry 😞 )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2022 07:41 AM
Use the global setting. Something like:
journalEntry.value.replace(/\n/gm, "<br/>")
P.S. or /\\n/gm, "<br/>" as regex expression (cant test it atm, sorry 😞 )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2022 08:09 AM
Wow! This works! Thanks a lot, I appreciate!!
P.S.: From where do you get this knowledge? I'm searching here and there, but am still not able to solve this type of things in my own. I have to say, my Javascript knowhow is practically zero; I just started learning through topics like these.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2022 04:00 AM
Glad I helped a bit 🙂
Well, it's standard RegEx and JS. You can do few free courses to get a better grasp on it (or best paid on Udemy for example, there are very good ones)
Here are link for a free and a paid one :
https://javascript.info/structure
https://www.udemy.com/course/modern-javascript-from-the-beginning/?ranMID=39197&ranEAID=jU79Zysihs4&ranSiteID=jU79Zysihs4-yOhYk4_7A6wvJtqr3eEicA&utm_source=aff-campaign&utm_medium=udemyads&LSNPUBID=jU79Zysihs4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2022 04:11 AM
Hello Joro,
Thanks a lot!