django-bootstrap-email
Usage
- Install
pip install django-bs-email
- Add to
INSTALLED_APPS
INSTALLED_APPS = [
# ...
"django_bootstrap_email",
]
- Use the
bootstrap_emailtemplate tag in your Django template
{% load bootstrap_email %}
{% bootstrap_email %}
<body class="bg-light">
<div class="container">
<div class="card my-10">
<div class="card-body">
<p>
{{ message }}
</p>
</div>
</div>
</div>
</body>
{% end_bootstrap_email %}
- Create the email and send it
context = {
"message": "Hello World!",
}
# you should always include a plain text version of the HTML email
text_content = context["message"]
html_content = render_to_string("path/to/template.html", context)
email_message = EmailMultiAlternatives(
subject="Greetings",
body=text_content,
from_email="me@test.com",
to=["you@test.com"],
)
email_message.attach_alternative(html_content, "text/html")
email_message.send()
This will produce a complete HTML email that renders consistently across email clients:
Metadata
Release files for django-bs-email 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django_bs_email-0.2.2.tar.gz | 3.6 kB | Without provenance | Details for django_bs_email-0.2.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_bs_email-0.2.2-py3-none-any.whl | Python 3 | none | any | Details for django_bs_email-0.2.2-py3-none-any.whl |
Total release size: 8.1 kB
Release files / django_bs_email-0.2.2.tar.gz
| Download URL | django_bs_email-0.2.2.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3074d222642c31dbcd3f263f65a855be3036f69bdd8f555582d59a6229bb4c33
|
|
BLAKE2b-256 checksum How to use checksums |
59421f3261b1d9ebc271d144459d7fbe796fefd01187b7bdcb66c69151938f49
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / django_bs_email-0.2.2-py3-none-any.whl
| Download URL | django_bs_email-0.2.2-py3-none-any.whl |
|---|---|
| Size | 4.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1505a02450d394c14ca590a4d258d49192fd41074aaf3a2b533c152b56992f93
|
|
BLAKE2b-256 checksum How to use checksums |
6a2105ffda7d948f1e05604a052318183d9a7bb46077b2d3e1841d1d561b4a39
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Security for django-bs-email 0.2.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.