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
Built Distribution
File details
Details for the file django-epfl-mail-1.0.0.tar.gz
.
File metadata
- Download URL: django-epfl-mail-1.0.0.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e1f9070473beab4018e916217e6f6a6d57b966b78db5eeb3a3ad43eba6b1de8 |
|
MD5 | 3a947c73ce29fe794589393792fa31f3 |
|
BLAKE2b-256 | 475de18d74160b95c682fec95f2479d4b74f4489f89ef1b7cad8f21caec234f5 |
File details
Details for the file django_epfl_mail-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: django_epfl_mail-1.0.0-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c226a79ad64a70f1ae586fb852c62d9e135bdab0557bb3c307fe4da26fa8d06 |
|
MD5 | ce69969fe1407f9d03cfa26ee2c45dee |
|
BLAKE2b-256 | 38aab8459635a8c7e80863cda1049814786dfe552b9d50ce11a2324a68469395 |