From 7786cb8e355bc094749fcce97af23e40716a5885 Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Tue, 17 Dec 2024 10:16:10 +0100 Subject: [PATCH] Added mailer config --- .env | 3 +++ CHANGELOG.md | 2 ++ config/packages/mailer.yaml | 4 ++++ docs/Production.md | 15 +++++++++++++-- 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/.env b/.env index 339a4b1..340a7e9 100644 --- a/.env +++ b/.env @@ -22,6 +22,9 @@ CORS_ALLOW_ORIGIN='^https?://(localhost|127\.0\.0\.1)(:[0-9]+)?$' MAILER_DSN=smtp://mail:1025 ###< symfony/mailer ### +# https://symfony.com/doc/current/mailer.html#configuring-emails-globally +MAILER_FROM='Aapodwalk ' + DEFAULT_LOCALE=da MEDIA_PROCESSOR_TEMPLATES='[ diff --git a/CHANGELOG.md b/CHANGELOG.md index a001220..c6bc0f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ See [keep a changelog](https://keepachangelog.com/en/1.0.0/) for information abo ## [Unreleased] +- [PR-38](https://github.com/itk-dev/aapodwalk_api/pull/38) + Added mailer config - [PR-34](https://github.com/itk-dev/aapodwalk_api/pull/34) UI improvements - [PR-33](https://github.com/itk-dev/aapodwalk_api/pull/33) diff --git a/config/packages/mailer.yaml b/config/packages/mailer.yaml index 56a650d..3d30eb0 100644 --- a/config/packages/mailer.yaml +++ b/config/packages/mailer.yaml @@ -1,3 +1,7 @@ framework: mailer: dsn: '%env(MAILER_DSN)%' + + # https://symfony.com/doc/current/mailer.html#configuring-emails-globally + headers: + From: '%env(MAILER_FROM)%' diff --git a/docs/Production.md b/docs/Production.md index 02ada02..eaf1ac5 100644 --- a/docs/Production.md +++ b/docs/Production.md @@ -10,7 +10,9 @@ APP_ENV=prod # See https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url DATABASE_URL="mysql://db:db@mariadb:3306/db?serverVersion=10.11.10-MariaDB&charset=utf8mb4" CORS_ALLOW_ORIGIN='^https?://(localhost|127\.0\.0\.1)(:[0-9]+)?$' -MAILER_DSN=smtp://localhost:25 + +MAILER_DSN="smtp://host.docker.internal:25?verify_peer=false" +MAILER_FROM="Aapodwalk " # Variables for tasks TASK_SITE_DOMAIN=aapodwalk_api.example.com @@ -38,9 +40,18 @@ task console -- dbal:run-sql "SELECT NOW(), DATABASE()" and that you can send email (used to unforget passwords): ``` shell -task console -- mailer:test +task console -- mailer:test --from=«the value of MAILER_FROM set in .env.local» ``` +> [!TIP] +> Run +> +> ``` shell +> task console -- debug:container --env-var=MAILER_FROM +> ``` +> +> to see the current value of `MAILER_FROM`. + If successful, install and update site: ``` shell