I am looking for a way to send emails from WordPress using the GMail API.
The most common way, used by almost all plugins available, is to authenticate using OAuth2, which has a few limitations.
- The From address should be the same (or alias) from the account that did the OAuth2.
- In case this account changes their password (eg from a policy), the emails will stop work without a notice
- It costs to keep an account open just for this case. In google workspace this is at least ~90€/y
An alternative is to use services like sendgrid, mailchimp, etc.
We do not want to do this for this simple scenario. Service chaos is already happening to many companies.
The ideal would be to use the GMail api directly from wordpress but there doesn’t seem to be any plugins doing that.