A Django application with templates for emails.
Project description
django-epfl-mail
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b7a1eb3a8350d6fe0d650dedc2230c597bdfb301a9d378ecef93057f050fd978
|
|
| MD5 |
e5964f06b861332ecda0e0ffa05ca824
|
|
| BLAKE2b-256 |
9178294efe743ba5e10d8ff68ea34ad52e41f16063bb6b8cfdf20d49aaaaf365
|
File details
Details for the file django_epfl_mail-2.0.0-py3-none-any.whl.
File metadata
- Download URL: django_epfl_mail-2.0.0-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1dced2775ff62ea679a1715f86c28574abbf718b100f1fac41335c947090af85
|
|
| MD5 |
614df29db233bfd52cd52fa709f224a3
|
|
| BLAKE2b-256 |
c8eed8a03c72b094de37253859798a121e3eaa816babaa83738f59d6f93dd1b6
|