cancel
Showing results for 
Search instead for 
Did you mean: 

HTML template for a table on the body of an Email

MadalinaAcsinte
Level 3
Hello,

I am trying to send emails via Blue Prism with a table from a collection in the body of an Email.


I managed to create the table with calculation properties in a loop, but I also need to highlight the new items in the table and I can't use CSS to edit the HTML table.

Do you know if its possible to add it from the calculation properties or I need a code stage for that?

This is from the calculation properties of the loop:
[Main Body]&"<tr><td>"&[Input collection.Name]&"</td>"&"<td>"&[Input collection.Personal Number]&"</td>"&"<td>"&[Input collection.Hours]&"</td>"&"<td>"&[Input collection.Date]&"</td>"&"<td>"&[Input collection.Year]&"</td></tr>"&NewLine()

And the generation of the final body:
"<table>"& NewLine() &
"<tr><th>Name</th>
<th>Personal Number</th>
<th>Hours</th>
<th>Date</th>
<th>Year</th></tr>"
&[Main Body]&
"</table>"

Any advice on how can I insert the CSS in this case?

Thank you!

------------------------------
Madalina Acsinte
------------------------------
1 BEST ANSWER

Helpful Answers

james.man
Staff
Staff
I am fairly certain that you can use inline css to style emails.  So inside your Loop, you would need a Decision stage to check to see if you need to add that CSS, and if so, add your CSS directly to the element (and not use stylesheets) using something like (assuming you are trying to bold the name):

[Main Body]&"<tr><td style=" & Chr(34) & "font-weight:bold;" & Chr(34) & ">"&[Input collection.Name]&"</td>"&"<td>"&[Input collection.Personal Number]&"</td>"&"<td>"&[Input collection.Hours]&"</td>"&"<td>"&[Input collection.Date]&"</td>"&"<td>"&[Input collection.Year]&"</td></tr>"&NewLine()

I'm fairly certain that should be right but please test it yourself. Chr(34) just means double quotation mark.

------------------------------
James Man
Professional Services
Blue Prism
Asia/Hong_Kong
------------------------------

View answer in original post

2 REPLIES 2

james.man
Staff
Staff
I am fairly certain that you can use inline css to style emails.  So inside your Loop, you would need a Decision stage to check to see if you need to add that CSS, and if so, add your CSS directly to the element (and not use stylesheets) using something like (assuming you are trying to bold the name):

[Main Body]&"<tr><td style=" & Chr(34) & "font-weight:bold;" & Chr(34) & ">"&[Input collection.Name]&"</td>"&"<td>"&[Input collection.Personal Number]&"</td>"&"<td>"&[Input collection.Hours]&"</td>"&"<td>"&[Input collection.Date]&"</td>"&"<td>"&[Input collection.Year]&"</td></tr>"&NewLine()

I'm fairly certain that should be right but please test it yourself. Chr(34) just means double quotation mark.

------------------------------
James Man
Professional Services
Blue Prism
Asia/Hong_Kong
------------------------------

VivekKaurav1
Level 2