Django mailing through admin
Project description
*************
django-postie
*************
This project allows you to send emails and manage them in the admin
panel.
By default package uses celery to send emails.
************
Installation
************
Update INSTALLED_APPS
.. code:: python
INSTALLED_APPS = [
...
'postie',
'parler',
'codemirror2',
'ckeditor',
'des',
...
]
Run migrations: ```python manage.py migrate```
Available settings
~~~~~~~~~~~~~~~~~~
``POSTIE_TEMPLATE_CHOICES`` - Tuple of tuples. Where the first value is
the value to use in code and second is verbose(translated).
``POSTIE_TEMPLATE_CONTEXTS`` - dictionary with template choices as keys
and dictionaries as values
For example:
.. code:: python
POSTIE_TEMPLATE_CONTEXTS = {
'mail_event': {
'context_var1': _('Context variable 1 description'),
'context_vae2': _('Context variable 2 user description'),
...
},
...
}
``POSTIE_INSTANT_SEND`` - whether to send letters instantly or to use
celery task. If ``False`` ``celery`` is required.
``POSTIE_HTML_ADMIN_WIDGET`` - dictionary with default widget for HTML field
in Template model in django admin interface
For example:
.. code:: python
POSTIE_HTML_ADMIN_WIDGET = {
'widget': 'TinyMCE',
'widget_module': 'tinymce',
'attrs': {'attrs': {'cols': 80, 'rows': 10}}
}
*********************
Basic example to use:
*********************
.. code:: python
# your_module.py
from postie.shortcuts import send_mail
send_mail(
event='MAIL_EVENT',
recipients=['email@email.com', 'email1@email1.com'],
context={
'var1': 'variable context',
'var2': 'another value'
},
from_email='noreply@email.com',
attachments=[{
'file_name': open('path-to-the-file')
}]
)
Full documentation check here - https://cyberbudy.gitlab.io/django-postie/
django-postie
*************
This project allows you to send emails and manage them in the admin
panel.
By default package uses celery to send emails.
************
Installation
************
Update INSTALLED_APPS
.. code:: python
INSTALLED_APPS = [
...
'postie',
'parler',
'codemirror2',
'ckeditor',
'des',
...
]
Run migrations: ```python manage.py migrate```
Available settings
~~~~~~~~~~~~~~~~~~
``POSTIE_TEMPLATE_CHOICES`` - Tuple of tuples. Where the first value is
the value to use in code and second is verbose(translated).
``POSTIE_TEMPLATE_CONTEXTS`` - dictionary with template choices as keys
and dictionaries as values
For example:
.. code:: python
POSTIE_TEMPLATE_CONTEXTS = {
'mail_event': {
'context_var1': _('Context variable 1 description'),
'context_vae2': _('Context variable 2 user description'),
...
},
...
}
``POSTIE_INSTANT_SEND`` - whether to send letters instantly or to use
celery task. If ``False`` ``celery`` is required.
``POSTIE_HTML_ADMIN_WIDGET`` - dictionary with default widget for HTML field
in Template model in django admin interface
For example:
.. code:: python
POSTIE_HTML_ADMIN_WIDGET = {
'widget': 'TinyMCE',
'widget_module': 'tinymce',
'attrs': {'attrs': {'cols': 80, 'rows': 10}}
}
*********************
Basic example to use:
*********************
.. code:: python
# your_module.py
from postie.shortcuts import send_mail
send_mail(
event='MAIL_EVENT',
recipients=['email@email.com', 'email1@email1.com'],
context={
'var1': 'variable context',
'var2': 'another value'
},
from_email='noreply@email.com',
attachments=[{
'file_name': open('path-to-the-file')
}]
)
Full documentation check here - https://cyberbudy.gitlab.io/django-postie/
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-postie-0.6.2.tar.gz
(15.4 kB
view hashes)
Built Distribution
Close
Hashes for django_postie-0.6.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6b1c7eff0d8613dc0d5127936734cc2b295079b875349e19f8befdad9230552 |
|
MD5 | faf7cca1e912e1fa463b78cbfa768009 |
|
BLAKE2b-256 | 63e1efb1ca9f8a5b81fca0fcf68689742918b60ff768140c513ed0efbb1de1b5 |