Hi
I trust that you are well. How am I able to use the below HTML format in Powerapps as it is giving me errors? Please see below. How do i sort out this issue?
Office365Outlook.SendEmail(
User().Email,
<html>
<head>
<style>
table, th, td {
border: 1px solid black;
}
th, td {
padding: 5px;
text-align: left;
}
</style>
</head>
<body>
<h2><span style="color:Red;font-weight:bold">***HIGH ALERT***</span></h2>
<p>Declaration Form</p>
<table style="width:100%">
<tr>
<th>Date:</th>
<td>Now()</td>
</tr>
<tr>
<th rowspan="1">Name:</th>
<td>Name_DataCardValue22.Text</td>
</tr>
<tr>
</tr>
<tr>
<th>Email:</th>
<td>Email_DataCardValue24.Text</td>
</tr>
<tr>
<th rowspan="1">Company:</th>
<td>Comp_DataCardValue23.Text</td>
</tr>
<tr>
</tr><tr>
<th>Department:</th>
<td>Dept_DataCardValue25.Text</td>
</tr>
<tr>
<th rowspan="1">Temperature:</th>
<td>Temp_DataCardValue27.Text</td>
</tr>
<tr> <tr>
<th>Travlled:</th>
<td>Radio_travld.Selected.Value</td>
</tr>
<tr>
<th rowspan="1">If you travelled, where?:</th>
<td>DataCardValue105.Text</td>
</tr>
<tr>
</tr><tr>
<th>Have you been infected with COVID:</th>
<td>Radio_infctd.Selected.Value</td>
</tr>
<tr>
<th rowspan="1">If Yes:</th>
<td> DataCardValue106.Text</td>
</tr>
<tr> <tr>
<th>Fever:</th>
<td> Radio_fever.Selected.Value </td>
</tr>
<tr>
<th rowspan="1">Shortness In Breath</th>
<td>Radio_SOB.Selected.Value</td>
</tr>
<tr>
</tr><tr>
<th>Chest Pain:</th>
<td>Radio_CP.Selected.Value</td>
</tr>
<tr>
<th rowspan="1">Cough:</th>
<td>Radio_cough.Selected.Value</td>
</tr>
<tr> <tr>
<th> Sore Throat:</th>
<td> Radio_ST.Selected.Value</td>
</tr>
<tr>
<th rowspan="1">Loss of Smell:</th>
<td>Radio_Smell.Selected.Value</td>
</tr>
<tr>
</tr><tr>
<th> Vomiting:</th>
<td>Radio_vomit.Selected.Value</td>
</tr>
<tr>
<th rowspan="1">Fatigue:</th>
<td>Radio_fatigue.Selected.Value</td>
</tr>
<tr>
</tr>
</table>
</body>
</html>,
{IsHtml:true})
Solved! Go to Solution.
The body parameter to the SendEmail action needs to be a text value - so you need to enclose your HTML in double quotes, like in the example below. Notice that if you have quotes in the HTML itself it needs to be escaped as "". And you need to concatenate the value of your data fields using the & operator (or the Concatenate function). Notice also that the second parameter to the SendEmail action is the e-mail subject that you are missing.
Office365Outlook.SendEmail(User().Email, "The subject for this e-mail", "<html>
<head>
<style>
table, th, td {
border: 1px solid black;
}
th, td {
padding: 5px;
text-align: left;
}
</style>
</head>
<body>
<h2><span style=""color:Red;font-weight:bold"">***HIGH ALERT***</span></h2>
<p>Declaration Form</p>
<table style=""width:100%"">
<tr>
<th>Date:</th>
<td>Now()</td>
</tr>
<tr>
<th rowspan=""1"">Name:</th>
<td>" & Name_DataCardValue22.Text & "</td>
</tr>
<tr>
</tr>
<tr>
<th>Email:</th>
<td>" & Email_DataCardValue24.Text & "</td>
</tr>
... the rest of the message here ...", {IsHtml:true})
Hope this helps!
The body parameter to the SendEmail action needs to be a text value - so you need to enclose your HTML in double quotes, like in the example below. Notice that if you have quotes in the HTML itself it needs to be escaped as "". And you need to concatenate the value of your data fields using the & operator (or the Concatenate function). Notice also that the second parameter to the SendEmail action is the e-mail subject that you are missing.
Office365Outlook.SendEmail(User().Email, "The subject for this e-mail", "<html>
<head>
<style>
table, th, td {
border: 1px solid black;
}
th, td {
padding: 5px;
text-align: left;
}
</style>
</head>
<body>
<h2><span style=""color:Red;font-weight:bold"">***HIGH ALERT***</span></h2>
<p>Declaration Form</p>
<table style=""width:100%"">
<tr>
<th>Date:</th>
<td>Now()</td>
</tr>
<tr>
<th rowspan=""1"">Name:</th>
<td>" & Name_DataCardValue22.Text & "</td>
</tr>
<tr>
</tr>
<tr>
<th>Email:</th>
<td>" & Email_DataCardValue24.Text & "</td>
</tr>
... the rest of the message here ...", {IsHtml:true})
Hope this helps!
Hi
Thank you