Skip to main content

A simple and customizable email template built for Django

Project description

django-simple-mail v1.0.2 on PyPi MIT license Stable

django-simple-mail

Simple customizable email template built for Django

Requirements

These Django app works with :

  • Python (>=2.7) (Need to be tested for 3.x)

  • Django (>=1.9) (Need to be tested for previous versions)

Installation

Install using pip :

pip install django_simple_mail

Add simple_mail to your INSTALLED_APPS setting.

INSTALLED_APPS = (
    ...
    'simple_mail',
)

Then run :

python manage.py makemigrations python manage.py migrate

Preview and customization:

The default mail template is a fork of Mailchimp email-blueprints and looks like this with placeholder values:

Email Preview

Email Preview

You can customize the template with CONTEXT settings :

DEFAULTS = {
    'CONTEXT': {
        'header_url': 'http://placehold.it/600x150',
        'footer_links': [],
        'footer_copyright': '',
        'footer_content': "Here is your content",
        'colors': {
            'background': "#EEEEEE",
            'container_border': "#DDDDDD",
            'container_background': "#FFFFFF",
            'container': "#505050",
            'title': "#444444",
            'footer': "#888888",
            'footer_link': "#2C9AB7",
            'button': "#2C9AB7",
        }
    }
}

Django Admin

You can manage your emails and their content directly from django admin :

Admin Preview

Admin Preview

You can also use variables inside the fields to make your content more dynamic :

Admin Preview

Admin Preview

Settings

Here are all the settings you can define:

SIMPLE_MAIL = {
    'CONTEXT': {
        'header_url': 'http://placehold.it/600x150',
        'footer_links': [],
        'footer_copyright': '',
        'footer_content': "Here is your content",
        'colors': {
            'background': "#EEEEEE",
            'container_border': "#DDDDDD",
            'container_background': "#FFFFFF",
            'container': "#505050",
            'title': "#444444",
            'footer': "#888888",
            'footer_link': "#2C9AB7",
            'button': "#2C9AB7",
        }
    },
    'TEMPLATE': 'simple_mail/default.html',
    'EMAILS': [],
    'BASE_URL': '',
    'FROM_EMAIL': ''
}

CONTEXT

Defines the values that needs to be populated to all your emails.

TEMPLATE

Defines the path to the template that is used by default. You can use this setting in case your want to modify the default template.

EMAILS

Defines the list of different emails that are used inside your project, for example :

DEFAULTS = {
    'EMAILS': [
        ['RESETPWD', 'Reset password'],
        ['WELCOME', 'Welcome a user'],
        ['VALIDATE', 'Validate a user email'],
    ]
}

BASE_URL

Defines the base url to resolve links.

FROM_EMAIL

Defines the mail to send from by default.

Support

If you are having issues, please let us know or submit a pull request.

License

The project is licensed under the MIT License.

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

django_simple_mail-1.0.2.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_simple_mail-1.0.2-py2.py3-none-any.whl (13.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file django_simple_mail-1.0.2.tar.gz.

File metadata

  • Download URL: django_simple_mail-1.0.2.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/2.7.14

File hashes

Hashes for django_simple_mail-1.0.2.tar.gz
Algorithm Hash digest
SHA256 66bf384c2b402538ce68c44303f3be8c06ce21003ba1df69356a4bf736f180d8
MD5 700693bb2ce8acb93df634a7d9be5699
BLAKE2b-256 61cbc647d77e00a71f6831b70c10e67b2042959e6579c43d2080fceec05c7cfd

See more details on using hashes here.

File details

Details for the file django_simple_mail-1.0.2-py2.py3-none-any.whl.

File metadata

  • Download URL: django_simple_mail-1.0.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 13.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/2.7.14

File hashes

Hashes for django_simple_mail-1.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 7a866c18505bb2511e9c8e33a58a3c5d52076df905d5bf2867c16b62c39f45b5
MD5 e66bc97529712a1b833c2ec46586dcf0
BLAKE2b-256 bf9e0bc78fbd9da5a56f0690daadc7033dd7c65b0425437e771805c42bfb3fb2

See more details on using hashes here.

Supported by

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