Skip to main content

Email History for Django Anymail

Project description

anymail-history - Email History for Django Anymail

CI tests Documentation MIT License

Keep history of all emails sent by Django Anymail

Introduction

anymail-history implements models and signals for Django Anymail.

Resources

Features

  • Store sent emails
  • Store tracking events
  • Display Admin
  • html templating

Requirements

  • Django >=3.2
  • Python >=3.7

How to

  1. Install
    $ pip install "django-anymail[mailgun]" "django-anymail-history"
    
  2. Configure Anymail
    INSTALLED_APPS = [
        # ...
        "anymail",
        "anymail_history",
        # ...
    ]
    
  3. Enjoy!

settings

You can add settings to your project’s settings.py either as a single ANYMAIL dict, or by breaking out individual settings prefixed with ANYMAIL_. So this settings dict:

ANYMAIL = {
    "STORE_HTML": True,
}

…is equivalent to these individual settings:

ANYMAIL_STORE_HTML = True

Available settings

  • ANYMAIL_STORE_FAILED_SEND: (default: False) Store message even if esp didn't returned a message-id.
  • ANYMAIL_STORE_HTML: (default: False) Store html alternatives.
  • ANYMAIL_RENDER_HTML: (default: True) Generate html alternatives.

Contribute

Principles

  • Simple for developers to get up-and-running
  • Consistent style (black, isort, flake8)
  • Future-proof (pyupgrade)
  • Full type hinting (mypy)

Coding style

We use pre-commit to run code quality tools. Install pre-commit however you like (e.g. pip install pre-commit with your system python) then set up pre-commit to run every time you commit with:

> pre-commit install

You can then run all tools:

> pre-commit run --all-files

It includes the following:

  • poetry for dependency management
  • isort, black, pyupgrade and flake8 linting
  • mypy for type checking
  • tox and Github Actions for builds and CI

There are default config files for the linting and mypy.

Tests

Tests package

The package tests themselves are outside of the main library code, in a package that is itself a Django app (it contains models, settings, and any other artifacts required to run the tests (e.g. urls).) Where appropriate, this test app may be runnable as a Django project - so that developers can spin up the test app and see what admin screens look like, test migrations, etc.

Running tests

The tests themselves use pytest as the test runner. If you have installed the poetry evironment, you can run them thus:

$ poetry run pytest

or

$ poetry shell
(anymail-history-py3.10) $ pytest

The full suite is controlled by tox, which contains a set of environments that will format, lint, and test against all support Python + Django version combinations.

$ tox
...
______________________ summary __________________________
  fmt: commands succeeded
  lint: commands succeeded
  mypy: commands succeeded
  py37-django32: commands succeeded
  py37-django40: commands succeeded
  py37-djangomain: commands succeeded
  py38-django32: commands succeeded
  py38-django40: commands succeeded
  py38-djangomain: commands succeeded
  py39-django32: commands succeeded
  py39-django40: commands succeeded
  py39-djangomain: commands succeeded

CI

There is a .github/workflows/tox.yml file that can be used as a baseline to run all of the tests on Github. This file runs the oldest LTS (3.2), newest (4.1), and head of the main Django branch.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

anymail_history-0.1.1.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

anymail_history-0.1.1-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file anymail_history-0.1.1.tar.gz.

File metadata

  • Download URL: anymail_history-0.1.1.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.10.5 Darwin/21.6.0

File hashes

Hashes for anymail_history-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f0832afc3845ad5508204e5bdf5cee1e1d015f8f1ee8b40d837dee755a64a1d2
MD5 bc778c9bde6f38ad174e2353873fa296
BLAKE2b-256 fb6b798e8cedd3b30e7618ef515f1033738e752415a4859224042048c94abc32

See more details on using hashes here.

File details

Details for the file anymail_history-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: anymail_history-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.10.5 Darwin/21.6.0

File hashes

Hashes for anymail_history-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d606f35e6713a9ba01aa31a4ed300132b474c48dec957ca388b8ddec46d5b82f
MD5 4476ed3d94e514cf213e678453198fb0
BLAKE2b-256 f0b05f5cef9e601dfbb67d05aa4c99d6a4b4a372669f5238fe7cd62741626b26

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page