Can't get variables to work in Alert Template html table

Im having an issue getting the variables to work correctly in the alert templates, under the fault heading Im trying to create a table for the faults. If I just put

Faults:{foreach %faults} #%key: %value.storage_descr %value.storage_perc% {/foreach}{/if}

I get the output you would expect
Fault: #1: C:\ 96%

But if I use those same variable’s in a html table I get no results just blank Boxes

{if %faults}<br>
Faults:{foreach %faults}  <br>
<table border="1" width="60%">
        <col style="width:20%">
	<col style="width:30%">
	<col style="width:10%">
<thead>
	<tr>
		<th>Host Name</th>
		<th><font color=orange>Storage Description</th>
		<th><font color=red>Percent Used</th>
</tr>
	</thead>
	<tbody>
	<tr>
		<td align="center">%hostname</td>
		<td align="center"><font color=orange>%storage_descr</td>
		<td align="center"><font color=red>%value.storage_perc%</td>
	</tr>
	</tbody>
</table>
{/foreach}{/if}

This is the result in the email

I have tried different variations of the variable also
%value.storage_descr
%storage_descr
%value.storage_perc%
%storage_perc%

I realize this will create a table for each Fault but at this point I just need to get the variable correct. Thanks in advance.

After moving the {foreach %faults} I am now getting variables. But im not sure where the {foreach %faults} needs to be to create a new table entry for each fault.

The second entry is just being written below the table.

{if %faults}<br>
Faults: <br>
<table border="1" width="60%">
        <col style="width:20%">
	<col style="width:30%">
	<col style="width:10%">
<thead>
	<tr>
		<th>Host Name</th>
		<th><font color=orange>Storage Description</th>
		<th><font color=red>Percent Used</th>
</tr>
	</thead>
	<tbody>
{foreach %faults} 
	<tr>
		<td align="center">%hostname</td>
		<td align="center"><font color=orange>%value.storage_descr</td>
		<td align="center"><font color=red>%value.storage_perc%</td>
	</tr>
{/foreach}
	</tbody>
</table>
{/if}
1 Like