Skip to main content

Email History for Django Anymail

Project description

anymail-history - Email History (database storage) for Django Anymail

CI tests codecov Documentation MIT License

Keep history of all emails sent by Django Anymail

Introduction

anymail-history implements database storage for Django Anymail.

Resources

Features

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

Requirements

  • Django >=3.2
  • Python >=3.8

How to

  1. Install Anymail

  2. Install

    $ pip install "django-anymail-history"
    
  3. Register anymail_history in your list of Django applications:

    INSTALLED_APPS = [
        # ...
        "anymail",
        "anymail_history",
        # ...
    ]
    
  4. Then migrate the app to create the database table manage.py migrate

  5. 🎉 Voila!

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.

Contribute

Principles

  • Simple for developers to get up-and-running
  • Consistent style (black, ruff)
  • 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
  • Ruff, black and pyupgrade linting
  • mypy for type checking
  • 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

CI

  • .github/workflows/lint.yml: defines and ensure coding rules on Github.

  • .github/workflows/test.yml: Runs tests on all compatible combinations of Django (3.2+) & Anymail(8.4+), Python (3.8+)in a Github matrix.

  • .github/workflows/coverage.yml: Calculates the coverage on an up to date version.

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.3.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

anymail_history-0.1.3-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: anymail_history-0.1.3.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.10.6 Linux/5.15.0-1031-azure

File hashes

Hashes for anymail_history-0.1.3.tar.gz
Algorithm Hash digest
SHA256 7b2b30df44d2a2dfce3ea3f84e43f18d6ae07e6cca5ca3047c542ab4bf717d54
MD5 7e71f9313a790c299e3028b357198f99
BLAKE2b-256 ecece6d40eb0d92f714f21fd82d13385f8b7ef8b225856a8fa806f96b7b0c0f7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: anymail_history-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.10.6 Linux/5.15.0-1031-azure

File hashes

Hashes for anymail_history-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 35796d2d687442813ad9cefe0ab19ae3d2542db13f48c4341b07bb7932cc84ba
MD5 7fe57cb9eaba267fdd3c71989b213910
BLAKE2b-256 63e43a6a106f201a0b3ff9884cec34f76c79987613bc45beb7980584c469501c

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