Skip to content

Commit

Permalink
Merge pull request #118 from KnpLabs/module/mailer-v2
Browse files Browse the repository at this point in the history
module: mailer v2
  • Loading branch information
AntoineGonzalez authored Apr 23, 2024
2 parents 069fb90 + 83716f2 commit 3a692d9
Show file tree
Hide file tree
Showing 15 changed files with 315 additions and 70 deletions.
2 changes: 1 addition & 1 deletion .env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ MYSQL_VERSION=8.0.27
MYSQL_DATABASE=databasorus
MYSQL_USER=user
MYSQL_PASSWORD=password
MAILER_DSN=smtp://mailhog:1025
MAILER_DSN=smtp://mailhog:1025
Binary file added assets/images/email/dino.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/pdf/cgu.pdf
Binary file not shown.
13 changes: 13 additions & 0 deletions assets/styles/email/dinosaur_has_been_created.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#title-wrapper {
display: flex;
align-items: center;
gap: 20px;
background-color: #E24C38;
color: #ffffff;
padding: 30px;
font-weight: normal;
}

img {
max-height: 100px;
}
12 changes: 12 additions & 0 deletions assets/styles/email/layout.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
body {
margin: 0;
padding: 0;
color: #17325C;
background-color: #f3f3f3;
font-family: Helvetica, Arial, sans-serif;
}

footer {
text-decoration: italic;
color: grey;
}
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"symfony/validator": "^7.0",
"symfony/web-link": "^7.0",
"symfony/yaml": "^7.0",
"twig/cssinliner-extra": "^3.9",
"twig/extra-bundle": "^3.8",
"twig/twig": "^3.8"
},
Expand Down
254 changes: 188 additions & 66 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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)%'
envelope:
sender: 'jurrasic.park@mail.com'
headers:
From: 'Jurassic Park <jurrasic.park@mail.com>'
5 changes: 4 additions & 1 deletion config/packages/twig.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
twig:
default_path: '%kernel.project_dir%/templates'
form_themes:
paths:
'%kernel.project_dir%/assets/images': images
'%kernel.project_dir%/assets/styles': styles
form_themes:
- 'bootstrap_5_layout.html.twig'
- 'form/bootstrap_5_layout.html.twig'

Expand Down
1 change: 1 addition & 0 deletions config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ parameters:
env(MYSQL_DATABASE): '%env(resolve:MYSQL_DATABASE)%'
env(MYSQL_USER): '%env(resolve:MYSQL_USER)%'
env(MYSQL_PASSWORD): '%env(resolve:MYSQL_PASSWORD)%'
app.pdf_directory: '%kernel.project_dir%/assets/pdf'

services:
# default configuration for services in *this* file
Expand Down
6 changes: 6 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,11 @@ services:
- db-data:/var/lib/mysql:rw
restart: unless-stopped

mailhog:
image: mailhog/mailhog
restart: on-failure
ports:
- 127.0.0.1:8025:8025

volumes:
db-data: ~
Loading

0 comments on commit 3a692d9

Please sign in to comment.