Skip to main content

A Django application with templates for emails.

Project description

django-epfl-mail

Build Status Coverage Status PyPI version PyPI Python version

A Django application with templates for emails.

Requirements

  • Python 2.7, 3.5 or later
  • Django 1.11, 2.2 or 3.2

Installation

Installing from PyPI is as easy as doing:

pip install django-epfl-mail

Documentation

Setup

Add 'django_epflmail' to your INSTALLED_APPS setting.

INSTALLED_APPS = [
    ...
    'django_epflmail',
]

Example template

from django.core.mail.message import EmailMessage
from django.template.loader import render_to_string

html = render_to_string("example.html", {"APP_TITLE": "Example"})
email = EmailMessage(
    "Email Example", html, "from@example.com", ["to@example.com"]
)
email.send()
{% extends "epflmail/default.html" %}
{% load i18n %}

{% block title %}
Email Example
{% endblock %}

{% block online %}
  {% with ONLINE_VERSION_LINK="https://example.com" %}
    {% include 'epflmail/includes/online.inc.html'%}
  {% endwith %}
{% endblock %}

{% block main %}
  <p>This is an example.</p>
{% endblock %}

{% block unsubscribe %}
  <a href="https://example.com">Unsubscribe link</a>
{% endblock %}

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-epfl-mail-0.1.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

django_epfl_mail-0.1.0-py2.py3-none-any.whl (8.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-epfl-mail-0.1.0.tar.gz.

File metadata

  • Download URL: django-epfl-mail-0.1.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.14

File hashes

Hashes for django-epfl-mail-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0b7013a20aa8890e8fc03e25bfd6ba5f979165650f0ec0f5a477d34a4f836f91
MD5 99b3f4fa3654dd6410267a5c26552040
BLAKE2b-256 7c3afa1559d8df14cc9ff62ab46a42c1ecb1a013e85be5e1d1ebe1bbc5911165

See more details on using hashes here.

Provenance

File details

Details for the file django_epfl_mail-0.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_epfl_mail-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 273b452609cb2b7a4593bce1868c84735ef254d8dc825cbee32318d5435465dc
MD5 7a7dbc8e9be3a63c49298e8b1bc8aa01
BLAKE2b-256 2759c39e452b5b129e2f8e2771e4de19ae489d1954346467898d21f01270724b

See more details on using hashes here.

Provenance

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