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 or 4.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.0.0.tar.gz (6.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_epfl_mail-2.0.0-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_epfl_mail-2.0.0.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for django_epfl_mail-2.0.0.tar.gz
Algorithm Hash digest
SHA256 b7a1eb3a8350d6fe0d650dedc2230c597bdfb301a9d378ecef93057f050fd978
MD5 e5964f06b861332ecda0e0ffa05ca824
BLAKE2b-256 9178294efe743ba5e10d8ff68ea34ad52e41f16063bb6b8cfdf20d49aaaaf365

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_epfl_mail-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1dced2775ff62ea679a1715f86c28574abbf718b100f1fac41335c947090af85
MD5 614df29db233bfd52cd52fa709f224a3
BLAKE2b-256 c8eed8a03c72b094de37253859798a121e3eaa816babaa83738f59d6f93dd1b6

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