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.6 or later
  • Django 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-1.0.0.tar.gz (5.8 kB view hashes)

Uploaded Source

Built Distribution

django_epfl_mail-1.0.0-py3-none-any.whl (8.4 kB view hashes)

Uploaded Python 3

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