Skip to content

Commit

Permalink
Added mailer config
Browse files Browse the repository at this point in the history
  • Loading branch information
rimi-itk committed Dec 17, 2024
1 parent 1652bcd commit 7786cb8
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -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 <no-reply@example.com>'

DEFAULT_LOCALE=da

MEDIA_PROCESSOR_TEMPLATES='[
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions config/packages/mailer.yaml
Original file line number Diff line number Diff line change
@@ -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)%'
15 changes: 13 additions & 2 deletions docs/Production.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <no-reply@example.com>"

# Variables for tasks
TASK_SITE_DOMAIN=aapodwalk_api.example.com
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7786cb8

Please sign in to comment.