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 3.7 or later
  • Django 2.2, 3.2, 4.2 or 5.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-2.1.0.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

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

django_epfl_mail-2.1.0-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file django_epfl_mail-2.1.0.tar.gz.

File metadata

  • Download URL: django_epfl_mail-2.1.0.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.26.2 CPython/3.13.0 Linux/6.8.0-90-generic

File hashes

Hashes for django_epfl_mail-2.1.0.tar.gz
Algorithm Hash digest
SHA256 d8eef80c7065bd1583efeb1914d14e636ecc1eabcca249237cb0140396ff2574
MD5 07dd80c801363063a29c4e7d1034b1d4
BLAKE2b-256 61ffd06311b1e0356f4015ececce18e09236c0f6dab57762e94b180601bf94a5

See more details on using hashes here.

File details

Details for the file django_epfl_mail-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: django_epfl_mail-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.26.2 CPython/3.13.0 Linux/6.8.0-90-generic

File hashes

Hashes for django_epfl_mail-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 879b421b8cec0a8f000cde0324d83e482bbbe305d667ac30c1033f34526a9e63
MD5 37a4b618dd19b325e33d9ccf538dde55
BLAKE2b-256 b6bcb8affd2065ed8e86517c44fd1e6b7232fe74831c17295f35a7af72186217

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