The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do I format e-mail body in Send a custom email post-function?

Szymon Trocha
July 19, 2019

Hi,

I'm having troubles in formatting the body of my e-mail I'm trying to send using Scriptrunner "Send custom e-mail" via post-function. I'm trying to get at least new lines but none of the ways work. This is my script in email template:

Dear Sirs,

First <% print "\n" %>
Second <% print "\\n" %>
Third <% out <<"\n" %>
Fourth <% out <<"\\n" %>
Fifth \n
Sixth \\n
This is the body, and should be a new line before and after

Regards,

<% out << issue.reporter?.displayName %>

But instead of any formatted email I get a single line:

"Dear Sirs, First Second Third Fourth \n Fifth Sixth \n This is the body, and should be a new line before and after Regards, John Smith"

Any help?

Thank you in advance

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
Thanos Batagiannis _Adaptavist_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
July 19, 2019

Hi Szymon

You can select an HTML template and then for every new line you could use <br>.

Also (unless you are in a very old version of the plugin) you could use the condition field and the config map to push the reporter name and then use it in the email template. 

So in your case you could have something like 

Screenshot 2019-07-19 at 15.42.38.png

Szymon Trocha
July 22, 2019

Thanos,

Works perfect! Thank you.

How could I miss such obvious way :-(

TAGS
AUG Leaders

Atlassian Community Events