May 6, 2022
Hello,
It depends on what is happening exactly. I can share some thoughts about it though.
I think you'll probably need to use some background processing. You might have two functions, one to enqueue the email sending action and other to process such queue.
Also, you can look at some services like SendGrid to make your job easier.