You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add documentation for config of relay service and Django app (#37)
* first draft of configuration docs
* add missing ending code block characters
* add space before code block
ticky-tack, but it bothers me so 🤷♂️
* add quotes and change conn age to correct name
* remove `EMAIL_BACKEND` from config docs
Copy file name to clipboardExpand all lines: README.md
+59Lines changed: 59 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -111,6 +111,65 @@ DATABASE_ROUTERS = [
111
111
112
112
## Configuration
113
113
114
+
### Relay Service
115
+
116
+
Configuration of the relay service differs depending on whether you are using the provided Docker image or the management command within a Django project.
117
+
118
+
#### Docker
119
+
120
+
When running the relay service using Docker, config values are set via environment variables. The names of the environment variables are the same as the Django settings, e.g. to set `DEBUG` to `True`, you would set `-e "DEBUG=True"` when running the container.
121
+
122
+
For settings that are dictionaries, a `__` is used to separate the keys, e.g. to set `DATABASES["default"]["CONN_MAX_AGE"]` to `600` or 10 minutes, you would set `-e "DATABASES__default__CONN_MAX_AGE=600"`.
123
+
124
+
#### Django
125
+
126
+
When running the relay service from a Django project, config values are read from the Django settings for that project.
127
+
128
+
### Django App
129
+
130
+
Configuration of the Django app is done through the `DJANGO_EMAIL_RELAY` dictionary in your Django settings. All settings are optional. Here is an example configuration, with the default values shown:
The database alias to use for the email relay database. This must match the database alias used in your `DATABASES` setting. A default is provided at `email_relay.conf.EMAIL_RELAY_DATABASE_ALIAS`. You should only need to set this if you are using a different database alias.
147
+
148
+
#### `EMAIL_MAX_BATCH`
149
+
150
+
The maximum number of emails to send in a single batch. The default is `None`, which means there is no limit.
151
+
152
+
#### `EMAIL_MAX_DEFERRED`
153
+
154
+
The maximum number of emails that can be deferred before the relay service stops sending emails. The default is `None`, which means there is no limit.
155
+
156
+
157
+
#### `EMAIL_MAX_RETRIES`
158
+
159
+
The maximum number of times an email can be deferred before being marked as failed. The default is `None`, which means there is no limit.
160
+
161
+
#### `EMPTY_QUEUE_SLEEP`
162
+
163
+
The time in seconds to wait before checking the queue for new emails to send. The default is `30` seconds.
164
+
165
+
#### `EMAIL_THROTTLE`
166
+
167
+
The time in seconds to sleep between sending emails, to avoid potential rate limits or overloading your SMTP server. The default is `0` seconds.
168
+
169
+
#### `MESSAGES_BATCH_SIZE`
170
+
171
+
The batch size to use when bulk creating `Messages` in the database. The default is `None`, which means Django's default batch size will be used.
172
+
114
173
## Inspiration
115
174
116
175
This package is heavily inspired by the [`django-mailer`](https://github.com/pinax/django-mailer) package. `django-mailer` is licensed under the MIT license, which is also the license used for this package. The required copyright notice is included in the [`LICENSE`](LICENSE) file for this package.
0 commit comments