@@ -15,13 +15,75 @@ To make emails work you have to properly configure a mail provider in Part-DB.
1515## Configuration
1616
1717Part-DB uses [ Symfony Mailer] ( https://symfony.com/doc/current/mailer.html ) to send emails, which supports multiple
18- automatic mail providers (like MailChimp or SendGrid ). If you want to use one of these providers, check the Symfony
18+ mail providers (like Mailgun, SendGrid, or Brevo ). If you want to use one of these providers, check the Symfony
1919Mailer documentation for more information.
2020
2121We will only cover the configuration of an SMTP provider here, which is sufficient for most use-cases.
2222You will need an email account, which you can use to send emails from via password-based SMTP authentication, this account
2323should be dedicated to Part-DB.
2424
25+ ### Using specialized mail providers (Mailgun, SendGrid, etc.)
26+
27+ If you want to use a specialized mail provider like Mailgun, SendGrid, Brevo (formerly Sendinblue), Amazon SES, or
28+ Postmark instead of SMTP, you need to install the corresponding Symfony mailer package first.
29+
30+ #### Docker installation
31+
32+ If you are using Part-DB in Docker, you can install additional mailer packages by setting the ` COMPOSER_EXTRA_PACKAGES `
33+ environment variable in your ` docker-compose.yaml ` :
34+
35+ ``` yaml
36+ environment :
37+ - COMPOSER_EXTRA_PACKAGES=symfony/mailgun-mailer
38+ - MAILER_DSN=mailgun+api://API_KEY:DOMAIN@default
39+ 40+ - EMAIL_SENDER_NAME=Part-DB
41+ - ALLOW_EMAIL_PW_RESET=1
42+ ` ` `
43+
44+ You can install multiple packages by separating them with spaces:
45+
46+ ` ` ` yaml
47+ environment :
48+ - COMPOSER_EXTRA_PACKAGES=symfony/mailgun-mailer symfony/sendgrid-mailer
49+ ` ` `
50+
51+ The packages will be installed automatically when the container starts.
52+
53+ Common mailer packages:
54+ - ` symfony/mailgun-mailer` - For [Mailgun](https://www.mailgun.com/)
55+ - ` symfony/sendgrid-mailer` - For [SendGrid](https://sendgrid.com/)
56+ - ` symfony/brevo-mailer` - For [Brevo](https://www.brevo.com/) (formerly Sendinblue)
57+ - ` symfony/amazon-mailer` - For [Amazon SES](https://aws.amazon.com/ses/)
58+ - ` symfony/postmark-mailer` - For [Postmark](https://postmarkapp.com/)
59+
60+ # ### Direct installation (non-Docker)
61+
62+ If you have installed Part-DB directly on your server (not in Docker), you need to manually install the required
63+ mailer package using composer.
64+
65+ Navigate to your Part-DB installation directory and run :
66+
67+ ` ` ` bash
68+ # Install the package as the web server user
69+ sudo -u www-data composer require symfony/mailgun-mailer
70+
71+ # Clear the cache
72+ sudo -u www-data php bin/console cache:clear
73+ ` ` `
74+
75+ Replace `symfony/mailgun-mailer` with the package you need. You can install multiple packages at once :
76+
77+ ` ` ` bash
78+ sudo -u www-data composer require symfony/mailgun-mailer symfony/sendgrid-mailer
79+ ` ` `
80+
81+ After installing the package, configure the `MAILER_DSN` in your `.env.local` file according to the provider's
82+ documentation (see [Symfony Mailer documentation](https://symfony.com/doc/current/mailer.html) for DSN format for
83+ each provider).
84+
85+ # # SMTP Configuration
86+
2587To configure the SMTP provider, you have to set the following environment variables :
2688
2789`MAILER_DSN` : You have to provide the SMTP server address and the credentials for the email account here. The format is
0 commit comments