Django utilities to help track emails sent using Postmark.
## Features
- Store emails (including failed attempts) sent from within your project
- Receive and store webhook notifications, for email bounces and deliveries
- Track sent emails for errors, bounces, and deliveries
- Resend emails
## Prerequisites
- [Django](https://www.djangoproject.com/)
- [Postmark](https://postmarkapp.com/) account
## Installation
```
$ pip install git+https://github.com/regulusweb/django-postmark-utils.git
```
Django Postmark Utils makes use of the Django email backend provided by [Postmarker](https://postmarker.readthedocs.io/en/latest/), so first configure it in your project's settings, as per the [documentation](https://postmarker.readthedocs.io/en/latest/django.html).
```python
EMAIL_BACKEND = 'postmarker.django.EmailBackend'
POSTMARK = {
'TOKEN': '<YOUR POSTMARK SERVER TOKEN>',
'TEST_MODE': False,
'VERBOSITY': 0,
}
```
Add the app to your project's `INSTALLED_APPS` setting:
```python
INSTALLED_APPS = (
'django_postmark_utils',
)
```
Create the required database tables:
```
$ python manage.py migrate django_postmark_utils
```
To receive [bounce](https://postmarkapp.com/developer/webhooks/bounce-webhook) and [delivery](https://postmarkapp.com/developer/webhooks/delivery-webhook) [webhook notifications](https://postmarkapp.com/developer/webhooks/webhooks-overview) from Postmark, configure the webhook URLs in your project's URL configuration:
```python
urlpatterns = [
url(r'^postmark/', include('django_postmark_utils.urls')),
]
```
In your project's settings, configure a secret to be added to the webhook URLs:
```python
POSTMARK_UTILS_SECRET = '<YOUR WEBHOOK URLS SECRET>'
```
Add the webhook URLs to your Postmark account:
`https://example.com/postmark/<YOUR WEBHOOK URLS SECRET>/bounce-receiver/`
`https://example.com/postmark/<YOUR WEBHOOK URLS SECRET>/delivery-receiver/`
Optionally change the default email header field name (`X-DjangoPostmarkUtils-Resend-For`) used to match resent emails to the messages they are for, in your project's settings:
```python
MESSAGE_ID_HEADER_FIELD_NAME = '<YOUR CUSTOM EMAIL HEADER FIELD NAME>'
```
## Usage
Emails (including failed attempts) sent via the Postmarker email backend will be stored in the database, and can be viewed in the admin.
In the email change page, clicking on the `Go to resend list` link next to the `Resend` field will send you to a list from where you can use the `Resend emails` admin action to resend the email.
Metadata
Release files for django-postmark-utils 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_postmark_utils-0.1-py3-none-any.whl | Python 3 | none | any | Details for django_postmark_utils-0.1-py3-none-any.whl |
Release files / django_postmark_utils-0.1-py3-none-any.whl
| Download URL | django_postmark_utils-0.1-py3-none-any.whl |
|---|---|
| Size | 17.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f033d7054faed54f8130d1ee77fab4b7ac83e5fa99590239080045e41d904ece
|
|
BLAKE2b-256 checksum How to use checksums |
b19bba479d04c386590e8055b8bd68e3936b370b47a3caa4bc8cc08f07215dae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-postmark-utils 0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.