Email Routing - Forwarding to multiple recipients
Hello, We are attempting to forward emails to multiple verified recipients. Such as:
That works generally, but sometimes one recipient's message.forward will result in an error, such as a 451. When this occurs, the processing halts, and further message.forward()'s don't occur (which makes sense given the code; i.e. [email protected] fails, [email protected] isn't attempted because the prior error).
With that, we've attempted handling the errors, and using Promise.all()/allSettled(), but the results are still less than ideal:
- just have a log of the error and no retry was attempted.
- the run is "successful" even if there was an error (which understandably won't retry)
- or we get a similar behavior as before where it stops at the error and no further message.forward()'s are processed
With that, is there any automatic retry logic when a Runtime API/Email Routing Worker fails (or specifically in a case of a 451)? I'm also open to any alternatives/suggestions for approaching something like this.
Thanks for your time!
0 Replies