A Django application with templates for emails.
Project description
django-epfl-mail
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)
Built Distribution
Close
Hashes for django_epfl_mail-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c226a79ad64a70f1ae586fb852c62d9e135bdab0557bb3c307fe4da26fa8d06 |
|
MD5 | ce69969fe1407f9d03cfa26ee2c45dee |
|
BLAKE2b-256 | 38aab8459635a8c7e80863cda1049814786dfe552b9d50ce11a2324a68469395 |