Response from novu.trigger
Let us say the preferences were saved to send email and not sms. When we call novu.trigger(..) can we know in the response which were sent?
10 Replies
Not from the response of the trigger call itself, but you can subsequently query
novu.messages.list({ transactionIds: [the_id] })
with the transactionId given back in the response to the trigger@Mei, you just advanced to level 2!
Just know that you would will have to handle concurrency stuff because the messages sent in response to a trigger happen in a queue that Novu has to get to, not immediately upon your trigger call, and if you’re using Digests then the messages aren’t sent until the digest window elapses.
Thanks. So when I call the trigger I get a response which has a transactionID in it which I can later use to call messages.list. However I cannot know when to call messages.list as I do not know when novu internal workers have actually sent the sms or email?
You have it correct
So maybe I should assume that novu sent stuff but to know what it sent I should query the preferences before triggering so at least I know what it was meant to send.
It’s possible to monitor the progress of the trigger’s jobs by querying the execution details, but I don’t know of any way to have Novu notify you when it’s finished sending messages for a trigger
Other than having the last step in the workflow be to send a webhook to your server 😂
Re: webhook - that sounds like what I need - thanks 🙂
Good luck!
Thank you for your help