ŠtosdenferŠ
Convex Community4mo ago
5 replies
Štosdenfer

Resend in internalAction instead of internalMutation

AdviceResolved
Currently the docs say to put sending emails via Resend inside an internal mutation.

I'm building a webshop which on return from a payment processors runs a mutation to patch the order document's status to
paid
and then sends an email to the customer that the order is received.

If the email fails (happened to me because I put the wrong email while testing), the order document doesn't get patched.

I'm guessing this is because the internalMutation also runs transactionally with the patch mutation, and if it fails, it also disgards the patch mutation.

If I were to move sending emails from an internal mutation to an internalAction, would that mitigate this?

It's crucial that the order get's patched even if the email fails.

Thanks!
Was this page helpful?