A very typical problem you might be stuck with is this:
My Custom scheduled messenger returns multiple issues. I need to send the results in nicely formatted emails. How do I achieve this?
And here's a screenshot that demonstrates a simple messenger template that outputs issue key, summary, assignee and deadline :
Ideally, you'd like to receive something like this:
Issue key | Summary | Assignee | Deadline |
---|---|---|---|
ABC-1 | Summary 1 | JBeth | 23/02/2015 |
MFP-53 | Summary MFP-53 as it comes from issue | mdodds | 02/05/2016 |
MFP-90 | Another example of issue | 17/03/2016 |
However, if we run the code as it is now, it will produce a result similar to the following:
ABC-1Summary 1JBeth23/02/2015MFP-53Summary MFP-53 as it comes from issuemdodds02/05/2016MFP-90Another example of issue17/03/2016
Not good, everything is in one line and there's even no line-breaks inside. Let's try to improve this.
Raley Notifications supports HTML formatting inside Code widgets, so, we could try to create a table like this:
Note, that inside of every iteration #foreach ($issue in $issues) we open and close a new table row. This will make our data look tabular. To improve readability of the data we add border to the table by declaring border="1". For more information about possible table formatting please refer to https://www.w3schools.com/html/html_tables.asp
NB! It is imperative that you use HTML formatting (like using <table> tags) ONLY inside Jirassimo widget of rich text editor. If you attempt to create a table directly in the editor by using similar code, then it will be literally rendered as
<table>
<tr>
<td>Issue key</td>
.....
</tr>
</table>