Just sends email. Simple, easy, multiformat.
Project description
=============
Django-Ogmios
=============
.. image:: https://travis-ci.org/fusionbox/django-ogmios.svg?branch=master
:target: https://travis-ci.org/fusionbox/django-ogmios
:alt Build Status
Just sends emails. Simple, easy, multiformat.
For those wondering, `Ogmios <https://en.wikipedia.org/wiki/Ogmios>`_ is just the Gallic god of eloquence.
Quickstart
==========
Install from PyPI with ``pip``: ``pip install django-ogmios``.
``yourproject/templates/mail/template.html``::
from: admin@example.org
to: Jane Doe <jane.doe@example.net>, {% for u in users %}{{ user.email }}, {% endfor %}
cc: John Doe <john.doe@example.org>, {{ copy_user.get_full_name }} <{{ copy_user.email }}>
bcc: anonymous@example.org, secret@example.com
subject: The whole email is a template
content-type: markdown
headers:
Reply-To: Jaqueline <jaqueline@example.net>
Organization: Example.org, Inc.
---
{% load special_filter %}
This is a list of special items:
{% for item in item_list %}
* {{ item|special }}
{% endfor %}
.. code:: python
import ogmios
ogmios.send_email('mail/template.html',
{'item_list': ['Hello']},
attachments=[{
'path': '/path/to/file/',
'name': 'file.txt',
'type': 'text/plain',
}])
This will render the content as markdown, and send the email with an HTML part and a Plaintext part.
For attachments, it is possible to just specify the path, or the path, filename and mimetype.
Tips
====
Resend an email with different context:
.. code:: python
import functools
import ogmios
from myapp.models import User
send_registration = functools.partial(ogmios.send, 'mail/template.html')
send_registration({'user': User.objects.get(pk=1337)})
Changelog
=========
0.11.1 (2018-10-12)
-------------------
- Fix email parsing [#15]
0.11.0 (2018-09-04)
-------------------
- Add support for Django > 1.11 and remove support for all prior versions.
0.10.0 (2016-04-13)
-------------------
- Add support for Django 1.9
- Drop support for Django 1.7
- Move method of adding attachments out of the template
and require attachments to be passed as an argument to ``send_email()``.
0.9.3 (2015-08-27)
------------------
- Add Django 1.7 compatibility.
0.9.2 (2015-07-16)
------------------
- Fix ``setup.py`` dependencies.
- Fix tests.
- Fix compatibility with django's cached loader.
- Fix context processing.
0.9.1 (2015-06-22)
------------------
- Fix 'From' field always being default
0.9.0 (2015-06-18)
------------------
- Initial version
Django-Ogmios
=============
.. image:: https://travis-ci.org/fusionbox/django-ogmios.svg?branch=master
:target: https://travis-ci.org/fusionbox/django-ogmios
:alt Build Status
Just sends emails. Simple, easy, multiformat.
For those wondering, `Ogmios <https://en.wikipedia.org/wiki/Ogmios>`_ is just the Gallic god of eloquence.
Quickstart
==========
Install from PyPI with ``pip``: ``pip install django-ogmios``.
``yourproject/templates/mail/template.html``::
from: admin@example.org
to: Jane Doe <jane.doe@example.net>, {% for u in users %}{{ user.email }}, {% endfor %}
cc: John Doe <john.doe@example.org>, {{ copy_user.get_full_name }} <{{ copy_user.email }}>
bcc: anonymous@example.org, secret@example.com
subject: The whole email is a template
content-type: markdown
headers:
Reply-To: Jaqueline <jaqueline@example.net>
Organization: Example.org, Inc.
---
{% load special_filter %}
This is a list of special items:
{% for item in item_list %}
* {{ item|special }}
{% endfor %}
.. code:: python
import ogmios
ogmios.send_email('mail/template.html',
{'item_list': ['Hello']},
attachments=[{
'path': '/path/to/file/',
'name': 'file.txt',
'type': 'text/plain',
}])
This will render the content as markdown, and send the email with an HTML part and a Plaintext part.
For attachments, it is possible to just specify the path, or the path, filename and mimetype.
Tips
====
Resend an email with different context:
.. code:: python
import functools
import ogmios
from myapp.models import User
send_registration = functools.partial(ogmios.send, 'mail/template.html')
send_registration({'user': User.objects.get(pk=1337)})
Changelog
=========
0.11.1 (2018-10-12)
-------------------
- Fix email parsing [#15]
0.11.0 (2018-09-04)
-------------------
- Add support for Django > 1.11 and remove support for all prior versions.
0.10.0 (2016-04-13)
-------------------
- Add support for Django 1.9
- Drop support for Django 1.7
- Move method of adding attachments out of the template
and require attachments to be passed as an argument to ``send_email()``.
0.9.3 (2015-08-27)
------------------
- Add Django 1.7 compatibility.
0.9.2 (2015-07-16)
------------------
- Fix ``setup.py`` dependencies.
- Fix tests.
- Fix compatibility with django's cached loader.
- Fix context processing.
0.9.1 (2015-06-22)
------------------
- Fix 'From' field always being default
0.9.0 (2015-06-18)
------------------
- Initial version
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-ogmios-0.11.1.tar.gz
(5.0 kB
view details)
File details
Details for the file django-ogmios-0.11.1.tar.gz
.
File metadata
- Download URL: django-ogmios-0.11.1.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.6+
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cba7570c71ac6e0b1feb2c68b140f9aef1c7030989c3d6d926df6f79d048b0a5 |
|
MD5 | 3b2292b82864f7be82be4a1e9a138861 |
|
BLAKE2b-256 | 46b6e3de88b0aafc6df989ff5b971c28b8c048b449d75281e1bd544d9db0ffbf |