Hello @jaimebs
I’ve tried ways to view a table in the Email endpoint but no success.
Is it possible to enter an array in the Email endpoint node (NodeRed) to show a table in the email body?
Payload : [{"bucket":"dados_aaaa","device":"aaaa","last_ts":"11:31:56 - 09/09"},{"bucket":"dados_bbbb","device":"bbbb","last_ts":"11:34:28 - 09/09"},{"bucket":"dados_cccc","device":"cccc","last_ts":"11:35:27 - 09/09"}]
Code :
<div style="width=100%; height:100%; overflow-y:scroll">
<table class="table table-striped">
<thead>
<tr>
<th>Bucket</th>
<th>Device</th>
<th>Data_Hora</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="entry in value">
<td>{{entry.bucket}}</td>
<td>{{entry.device}}</td>
<td>{{entry.last_ts}}</td>
</tr>
</tbody>
</table>
</div>
Email Endpoint:
Email Received:
I’m trying to insert the JSON(Payload) data from your example (below) into a table:
Hi @George_Santiago
We have released a new version of the plugin with some improvements. For your use case it may resolve some of your issues and make your flows simpler. Check it out and let us know how we can improve.
Indeed, this flow is not really adequate for your use case, and you would need to have a number of intermediate nodes that can bring all the necessary information together before calling the endpoint.
I’ve tried to achieve your requirements with a flow, I’ll leave it here so …
Could the email endpoint accept an HTML ‘body/payload’ (with the template node) via NodeRED?
Would it be possible to attach images? Or would it be better to encode Images in base64 or via link?
ega
September 12, 2022, 2:12pm
3
Hi,
I am not sure if the endpoint email body accepts the AngularJS commands.
For this (building the dynamic email body) I would use the node red, sending the email directly from node red without using the email endpoint.
Hope this helps.
1 Like
jaimebs
September 12, 2022, 2:46pm
4
As @ega states, the endpoint email body does no currently accept Angular directives, and the only way to send a formatted email would be to use an external node or service capable of handling this issue.
Nevertheless, we will analyze the issue and try to include some kind of solution in future releases.
1 Like
Thanks for the sugestion @jaimebs and @ega
I’ve googled and seen that there are Amazon SES and SNS nodes available in the NodeRED repository, but I haven’t tested it yet.
Amazon SES:
node-red-contrib-aws-ses-send 0.11
node-red-contrib-aws-ses 0.1
Amazon SNS:
node-red-contrib-aws 0.7
ega
September 12, 2022, 3:24pm
6
Hi,
Also you may use an external SMTP service, calling from node red, it not necessarily must be the instance’s mail service.
Hope this helps.