This Django Basic Email enable you to create emails in easy way.
This CMS is know to work on Django 1.4+ with Python 2.6+ and 3.3+
Get package or install by pip:
pip install django-basic-email
Modify your settings.py. Add 'basic_email' to your
INSTALLED_APPS like this:
INSTALLED_APPS = (
...
'basic_email',
)Add BASIC_EMAILS_DIRECTORY variable and point it to the directory you will use. Preferred:
BASIC_EMAIL_DIRECTORY = 'emails'Create template emails/email_example.html and txt version emails/email_example.txt. If txt version is not available it will use html2text converted html version. Send email:
from basic_email.send import send_email
send_email('example', '[email protected]', 'Hello')- Options:
templatetemplate name from schemeemails/email_<name>.html(txt version is derived from this name by changing extension)email- receiver emailsubject- subject emailvariables- dict with variables to pass to template renderfail_silently- flag if error in sending email should raise (defaultFalse)replace_variables- dict with variables to replace in templatereply_to- reply_to headerattachments- attachments list (file objects)memory_attachments- attachments list (string objects)
- Fork repository (if you don't have write permission).
- Create a branch.
- Add feature or fix a bug.
- Push code.
- Create a Pull Request.
Require Tox>=1.8
Testing all platforms
tox
Testing one platforms
tox -e <platform>
Example:
tox -e py27-django-17
Create virtual environment:
# Preparing virtualenv paths (optional if your profile doesn't have it). export WORKON_HOME=~/Envs source /usr/bin/virtualenvwrapper_lazy.sh # or: source /usr/local/bin/virtualenvwrapper_lazy.sh # Start by creating a virtual environment using the helper scripts provided. Do not include the systems site-packages. mkvirtualenv django-basic-email --no-site-packages workon django-basic-email
Install
django-basic-emailin editable mode:pip install -e .
Run example project:
cd example_project && ./manage.py migrate && ./manage.py runserver