This short guides shows how to setup Plausible CE v2.1.0-rc.1 (or later) email delivery using your Gmail account.
Go to your Google security settings and create an app password to be used in Plausible CE
Update your configuration to use the Bamboo.Mua
mailer adapter. Your current SMTP_*
settings will still work.
plausible-conf.env
BASE_URL=https://plausible.example.com
SECRET_KEY_BASE=PkVcxRgQDfQyhPETlog3vvCrj5LdYFSv4ejPEJHJO+i/37w6RZfRjeVCpJayjUjJMfXsNurcv5upPhTRoD3KgQ==
TOTP_VAULT_KEY=aihU7k+GSBKbcVFuX9VEPyUhuwlKEomqA94/SQQ0NR4=
+ MAILER_ADAPTER=Bamboo.Mua
+ MAILER_EMAIL=your-username-here@gmail.com
+ SMTP_HOST_ADDR=smtp.gmail.com
+ SMTP_HOST_PORT=587
+ SMTP_USER_NAME=your-username-here@gmail.com
+ SMTP_USER_PWD="wnqj fkbn jcwc byxk"
Due to the immutable nature of containers, you need to recreate plausible
to apply the new environment variables.
console
$ docker compose stop plausible
$ docker compose rm plausible
$ docker compose up -d
Now verify the updated configuration and try sending a test email.
console
$ docker compose exec plausible bin/plausible remote
iex> Application.get_env :plausible, Plausible.Mailer
#==> [
#==> adapter: Bamboo.Mua,
#==> auth: [username: "your-username-here@gmail.com", password: "wnqj fkbn jcwc byxk"],
#==> relay: "smtp.gmail.com",
#==> port: 587
#==> ]
iex> {:ok, _delivered_email} =
Plausible.Mailer.deliver_now(
Bamboo.Email.new_email(
# pick one of your own mailboxes
to: "your-username-here@gmail.com",
from: PlausibleWeb.Email.mailer_email_from(),
text_body: "test"
)
)
If it's delivered, you are all set! If not, leave the comment below and we'll try to help :)
@ruslandoga Now I can also see the section for "App Passwords" under Security → 2-Step Verification. I think it only shows up there, once you set an app password. But you can't actually add a new app password in here.
I only found it myself by using the search bar
After I added an App Password in there, then it also showed up here
![image](https://private-user-images.githubusercontent.com/15885290/330016170-adfc4dfc-eb45-402b-850e-20812ba47918.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg2Mzg2NTAsIm5iZiI6MTcxODYzODM1MCwicGF0aCI6Ii8xNTg4NTI5MC8zMzAwMTYxNzAtYWRmYzRkZmMtZWI0NS00MDJiLTg1MGUtMjA4MTJiYTQ3OTE4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjE3VDE1MzIzMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQ1MDZmNTBmYThiYjNhZTEwMGJlZTUzNjQ4YWY2NzkzZmY4Y2RmY2UzMzhkOTBkMTU2NWFlMjExY2QyODQwMDkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.UIspa9qusDs8sknrF3AZOAPOtXp_FI72-SYDFEabWjM)
OK, I'll see later if I can use the ordinary simple SMPT mailbox with my domain instead of Google Workspace.