Skip to content

Commit

Permalink
add usage to README (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuadavidthomas authored Oct 23, 2023
1 parent 2776bd4 commit b2146b4
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,23 @@ TODO

## Usage

TODO
Once your Django project is configured to use `email_relay.backend.RelayDatabaseEmailBackend` as it's `EMAIL_BACKEND`, sending email is as simple as using Django's built-in ways of sending email, such as the `send_mail` method:

```python
from django.core.mail import send_mail

send_mail(
"Subject here",
"Here is the message.",
"from@example.com",
["to@example.com"],
fail_silently=False,
)
```

Any emails sent this way, or one of the other ways Django provides, will be stored in the database queue and sent by the relay service.

See the Django documentation on [sending email](https://docs.djangoproject.com/en/dev/topics/email/) for more information.

## Configuration

Expand Down

0 comments on commit b2146b4

Please sign in to comment.