Details:
We use WordPress as our websiteThe admin sends one email to our 500 users a dayThe emails are being sent via wp_mail() with $to as an array of 500 usersWe use SendGrid as our transactional email service
Problem:
The website script waits until Sendgrid responds to the wp_mail request to say done. And the spinner on the web page shows the entire time while waiting for SendGrid to respond. This can take up to 20 minutes.
We now have 2 options to solve this problem.
Questions:
For option 1:
Where is the bottleneck? At WP mail or SendGrid or somewhere else?How can we increase the speed of the mails to be sent?
For option 2:
How can we initiate the sending of emails and not have the script wait for a “sent” response from Sendgrid/WP mail?