Limit "each" function for abandoned cart
I am using the "Each" function to create an email with the list of products that are left in the abandoned cart. The code already works this way but I need to limit it to bringing me a maximum of 5 products from the cart.
This is the code im using
<table>
<tbody>
{{#each context.journey.events.eventId.productListItems as |product|}}
<tr>
<td style="padding-right:20px;">
<img src="{{product.productImageUrl}}" height="150" width="150">
</td>
<td style="padding-right:10%;">
<b>{{product.name}}</b>
</td>
<td style="text-align:right;padding-right:20px;">
<b>${{product.priceTotal}}</b><br>
<p>
<a href="{{product.product}}">See product</a>.
</p>
</td>
</tr>
{{/each}}
</tbody>
</table>