Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added mailer config #38

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading