Extensions for django-mail-factory, like django-xadmin integration or asynchronous message sending
Project description
Extra features for django-mail-factory.
New features:
SMS factory to handle SMS like mails, Twilio integration implemented.
Async email class to send email via celery.
SMS Factory:
Defining SMS templates:
Define your templates inside a folder templates/sms/<template_name>/body.html.
Registering a SMS message using Twilio backend (Twilio python client needed):
from mailfactory_extras import smsfactory from mailfactory_extras.sms.twilio.sms import TwilioSMS class InvitationSMS(TwilioSMS): template_name = "invitation" params = ['user'] smsfactory.register(InvitationSMS)
template_name defines the name of the template to use.
params is the dict with the context variables the template will receive.
Sending SMS, just call send() from the smsfactory:
from mailfactory_extras import smsfactory smsfactory.send('invitation', {'user': 'Foo'})
Async email class:
Define your email class using CeleryMail.
from mail_factory import factory
from mailfactory_extras.backends.celery import CeleryMail
class InvitationAsyncEmail(CeleryMail):
template_name = "invitation"
params = ['user']
factory.register(InvitationAsyncEmail)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Hashes for django-mailfactory-extras-0.24.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a610d532e49adda2081d28ec36a9e84d4e62cced26e2a8853cac4fe231ee9c9 |
|
MD5 | 8d1c5de7fd64d8578231205e7a1c04c2 |
|
BLAKE2b-256 | 834f07a9828b1f6507e6bd3103ccc955b3ec5cd1bdd7dca9adacaf2ec2187f76 |