Skip to content

Commit 67be197

Browse files
committed
ISSUE-345: doc
1 parent d3ddd13 commit 67be197

File tree

3 files changed

+119
-1
lines changed

3 files changed

+119
-1
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,11 @@ this code.
5353
## Structure
5454

5555
* [Class Docs][docs/phpdoc/]
56+
* [Mailer Transports](docs/mailer-transports.md) - How to use different email providers (Gmail, Amazon SES, Mailchimp, SendGrid)
5657
* [Class structure overview](docs/ClassStructure.md)
5758
* [Graphic domain model](docs/DomainModel/DomainModel.svg) and
5859
a [description of the domain entities](docs/DomainModel/Entities.md)
60+
* [Mailer Transports](docs/mailer-transports.md) - How to use different email providers (Gmail, Amazon SES, Mailchimp, SendGrid)
5961

6062

6163
## Running the web server
@@ -203,6 +205,17 @@ phpList module), please use the
203205
[REST API](https://github.com/phpList/rest-api).
204206

205207

208+
## Email Configuration
209+
210+
phpList supports multiple email transport providers through Symfony Mailer. The following transports are included:
211+
212+
* Gmail
213+
* Amazon SES
214+
* Mailchimp Transactional (Mandrill)
215+
* SendGrid
216+
217+
For detailed configuration instructions, see the [Mailer Transports documentation](docs/mailer-transports.md).
218+
206219
## Copyright
207220

208221
phpList is copyright (C) 2000-2021 [phpList Ltd](https://www.phplist.com/).

docs/ClassStructure.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ database access code in these classes.
2121

2222
### Repository/
2323

24-
These classes are reponsible for reading domain models from the database,
24+
These classes are responsible for reading domain models from the database,
2525
for writing them there, and for other database queries.
2626

2727

docs/MailerTransports.md

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# Using Different Mailer Transports in phpList
2+
3+
This document explains how to use the various mailer transports that are included in the phpList core dependencies:
4+
5+
- Google Mailer (Gmail)
6+
- Amazon SES
7+
- Mailchimp Transactional (Mandrill)
8+
- SendGrid
9+
10+
## Configuration
11+
12+
The phpList core uses Symfony Mailer for sending emails. The mailer transport is configured using the `MAILER_DSN` environment variable, which is defined in `config/parameters.yml`.
13+
14+
## Available Transports
15+
16+
### 1. Google Mailer (Gmail)
17+
18+
To use Gmail as your email transport:
19+
20+
```
21+
# Using Gmail with OAuth (recommended)
22+
MAILER_DSN=gmail://USERNAME:APP_PASSWORD@default
23+
24+
# Using Gmail with SMTP
25+
MAILER_DSN=smtp://USERNAME:[email protected]:587
26+
```
27+
28+
Notes:
29+
- Replace `USERNAME` with your Gmail address
30+
- For OAuth setup, follow [Symfony Gmail documentation](https://symfony.com/doc/current/mailer.html#using-gmail-to-send-emails)
31+
- For the SMTP method, you may need to enable "Less secure app access" or use an App Password
32+
33+
### 2. Amazon SES
34+
35+
To use Amazon SES:
36+
37+
```
38+
# Using API credentials
39+
MAILER_DSN=ses://ACCESS_KEY:SECRET_KEY@default?region=REGION
40+
41+
# Using SMTP interface
42+
MAILER_DSN=smtp://USERNAME:[email protected]:587
43+
```
44+
45+
Notes:
46+
- Replace `ACCESS_KEY` and `SECRET_KEY` with your AWS credentials
47+
- Replace `REGION` with your AWS region (e.g., us-east-1)
48+
- For SMTP, use the credentials generated in the Amazon SES console
49+
50+
### 3. Mailchimp Transactional (Mandrill)
51+
52+
To use Mailchimp Transactional (formerly Mandrill):
53+
54+
```
55+
MAILER_DSN=mandrill://API_KEY@default
56+
```
57+
58+
Notes:
59+
- Replace `API_KEY` with your Mailchimp Transactional API key
60+
- You can find your API key in the Mailchimp Transactional (Mandrill) dashboard
61+
62+
### 4. SendGrid
63+
64+
To use SendGrid:
65+
66+
```
67+
# Using API
68+
MAILER_DSN=sendgrid://API_KEY@default
69+
70+
# Using SMTP
71+
MAILER_DSN=smtp://apikey:[email protected]:587
72+
```
73+
74+
Notes:
75+
- Replace `API_KEY` with your SendGrid API key
76+
- For SMTP, the username is literally "apikey" and the password is your actual API key
77+
78+
## Testing Your Configuration
79+
80+
After setting up your preferred mailer transport, you can test it using the built-in test command:
81+
82+
```bash
83+
bin/console app:send-test-email [email protected]
84+
```
85+
86+
## Switching Between Transports
87+
88+
You can easily switch between different mailer transports by changing the `MAILER_DSN` environment variable. This can be done in several ways:
89+
90+
1. Edit the `config/parameters.yml` file directly
91+
2. Set the environment variable in your server configuration
92+
3. Set the environment variable before running a command:
93+
```bash
94+
MAILER_DSN=sendgrid://API_KEY@default bin/console app:send-test-email [email protected]
95+
```
96+
97+
## Additional Configuration
98+
99+
Some transports may require additional configuration options. Refer to the Symfony documentation for more details:
100+
101+
- [Symfony Mailer Documentation](https://symfony.com/doc/current/mailer.html)
102+
- [Gmail Transport](https://symfony.com/doc/current/mailer.html#using-gmail-to-send-emails)
103+
- [Amazon SES Transport](https://symfony.com/doc/current/mailer.html#using-amazon-ses)
104+
- [Mailchimp Transport](https://symfony.com/doc/current/mailer.html#using-mailchimp)
105+
- [SendGrid Transport](https://symfony.com/doc/current/mailer.html#using-sendgrid)

0 commit comments

Comments
 (0)