A Django application with templates for emails.
Project description
django-epfl-mail
A Django application with templates for emails.
Requirements
- Python 2.7, 3.5 or later
- Django 1.11, 2.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.0.2.tar.gz
(5.9 kB
view hashes)
Built Distribution
Close
Hashes for django_epfl_mail-0.0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c387b635861d22a50dbaa250ba0d070f7f2d21519af605eca4ffb935e26f6d68 |
|
MD5 | dbdb0942397a54544c27c4e4b4db34a1 |
|
BLAKE2b-256 | 329ed9e0e8520a9428d3371f6543dce192d26f73b3ed2607f72d9eea10891b1d |