I am trying to set up trellis with the sendinblue API.
I got it to work with SMTP but I’d like to use a separate API key for each site I’m working on. I am able to ssh into the production server and use curl to send an e-mail through the sendinblue API, using my API key with the example from the sendinblue documentation.
This is how I have set up my trellis/group_vars/all/mail.yml:
I did put the API key into trellis/group_vars/all/vault.yml:
# Documentation: https://roots.io/trellis/docs/vault/
# Variables to accompany `wordpress_env_defaults` in `group_vars/all/helpers.yml`
# Note: These values can be overriden by `vault_wordpress_sites.*.env`
# my_api_key: 'available to all environments'
I have three questions, would appreciate any help:
ssmtp can only use SMTP. It seems like Sendinblue does support SMTP? Do you need to use the API then? If you need to use an HTTP based API for email, then you can bypass SMTP entirely and use a WP plugin.
Oh, I think I misunderstood something then. Sorry! (The documentation seems to suggest that API keys can be used here. Should I make a pull request to slightly change that part of the docs?)
Yes I can use SMTP but I am planning on using the same account across multiple sites (I’m cheap) and thought it would be cleaner to use an individual API key for each site, instead of the same SMTP user name / password across all sites.
then you can bypass SMTP entirely and use a WP plugin
But, but … I wanted to bypass plugins
So what I have done is install the sendinblue plugin and given it the API key. It all works now.
That’s the Roots spirit I’m hoping this limitation will be removed once Trellis switches to msmtp.
the docs use those words because the terminology is set by the email provider. For example, Sendgrid requires you to use an “api key” even if you’re using SMTP. I think it’s accurate but we’d welcome suggestions to improve it anyway. I do realize it’s a bit confusing when you’re choosing between SMTP and an API and still use an “api key” to auth with SMTP but that’s how some providers do it.