Django CBMail
Django module to easily send templated emails in a DRY way using classes, just like Class Based Views.
- Table of contents:
How to install
To install the app run :
pip install django-cbmail
or add it to the list of requirements of your project.
Example usage
Create a mails.py and use the BaseMail class to define your email like:
from cbmail.base import BaseMail
class ExampleEmail(BaseMail):
""" """
template_name = "myapp/mails/myemail.html"
subject = "Example subject of email"
And send it using:
ExampleEmail().send(['example@example.com'])
Where ['example@example.com'] is a list of emails of destination or a object with get_mailing_list method defined
Settings reference
To give support to this app we need to declare de following django settings:
DEFAULT_FROM_EMAIL = "example@example.com"
CBMAIL = {
'DEFAULT_REPLY_TO': "examplereplyto@example.com",
'DEFAULT_SUJECT': "Example subject",
'BASE_URL': "https://domain.com",
'EXTRA_DATA': {},
'WHITELIST': []
}
DEFAULT_FROM_EMAIL: Default setting of Django that defines the from email
DEFAULT_REPLY_TO: Default reply to be used on emails
DEFAULT_SUJECT: Default subject to be used on emails
WHITELIST: List of valid emails to send to
BASE_URL: The base url of your website
EXTRA_DATA: Any extra data intended to be used on all emails (This is injected on context of template)
License
MIT license, see the LICENSE file. You can use obfuscator in open source projects and commercial products.
Metadata
Release files for django-cbmail 0.1.1
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 | |
|---|---|---|---|---|
| django-cbmail-0.1.1.tar.gz | 10.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_cbmail-0.1.1-py2-none-any.whl | Python 2 | none | any | Details |
Total release size: 20.4 kB
Release files / django-cbmail-0.1.1.tar.gz
| Download URL | django-cbmail-0.1.1.tar.gz |
|---|---|
| Size | 10.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1558eeec688b6a5200a0957bd99301a6362b19574548a1456bd3d7a6b7471487
|
|
BLAKE2b-256 checksum How to use checksums |
50577e33a1ee9be5f9456b5e39173050441875fc437da80100eefc2d9c526ec5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / django_cbmail-0.1.1-py2-none-any.whl
| Download URL | django_cbmail-0.1.1-py2-none-any.whl |
|---|---|
| Size | 10.4 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
f57cec171d45a51940919bbb9ad3c8e4350c16d2d278b52cc684eed3eb580809
|
|
BLAKE2b-256 checksum How to use checksums |
3993b1fe479ef2dba99028ffbd456da326a36d0d508ea619b7f5676f28a7d3f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-cbmail 0.1.1
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.