Hi,
I am trying to send an email once a day using the trigger node but it is not working, is the trigger node able to do this without an input or does it require an inject node to start it off and if that is the case do I have to start it with a click to the inject node every time the system has been off ?
Inject nodes is what you need with a suitable setting for the time you want it to occur (see the settings on the inject node at the bottom regarding timing)
Alternatively, you can install the highly customisable node-red-contrib-cron-plus for much greater control.
The way you have the trigger node set up it will send the first message it receives (eg from an inject), then nothing for 24 hours, then one more message.
After that another incoming message will be sent on straight away and reset the trigger.
So it would be possible to have a message passed on at
25-06-2025 00:00:01, then resent at
26-06-2025 00:00:01, and if a new message arrives at
26-06-2025 01:05:00 and then it's resent at
27-06-2025 01:05:00.
There is an option in the trigger node to resend every 24 hours
However, you might end up with multiple parallel message queues waiting their own 24 hour period. To avoid it you could set msg.reset in each incoming message.
I think the queued message would be lost in the event of a deploy or Node-red restart.
Depending on the data you are emailing it's probably simpler to have an inject node set to fire at a specific time every day.
Hi Jbudd,
I have no incoming message, basically I have a formatted email with the contents of global variables, so it sends the current temperatures via email, I just need to automate sending them
Because you have "inject once after 0.1 seconds" ticked.
also, you are probably doing a "FULL deploy" instead of "CHANGED NODES ONLY deploy" - that causes all nodes to be destroyed and recreated (and therefore inject triggers again)
If you use "CHANGED NODES ONLY deploy" or disable "inject once after 0.1 seconds" or use cron-plus this wont happen
Thanks for the info, I have de checked the inject after box and will see how it goes, also the Deploy info was much appreciated, I will try and get my head around cron plus too as it looks like it can do a lot.