Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/almet/mass-emailer.py
Send emails from templates and datasets.
https://github.com/almet/mass-emailer.py
Last synced: 15 days ago
JSON representation
Send emails from templates and datasets.
- Host: GitHub
- URL: https://github.com/almet/mass-emailer.py
- Owner: almet
- Created: 2016-09-07T21:28:19.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-12-11T15:40:42.000Z (about 5 years ago)
- Last Synced: 2024-10-15T08:44:03.875Z (about 2 months ago)
- Language: Python
- Homepage:
- Size: 15.6 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
Mass emailer
############Python script to send email templates from a list of emails, a template and
replacement data for the templates.This works as follows:
Create the templates
====================Create the templates using the Jinja2 syntax. For instance::
Hi {name}, you are receiving this email because you are {reason}.
Thanks for all of what you are doing,
Cheers,
The team.Create this file and let's say you name it ``body``. Create a second template
named ``subject`` with the subject of the email.Create the list of emails + info
================================Every format supported by `tablib `_
will work correctly.For instance, let's say we have a json file with the following values, named
``dataset.json``::'[
{"reason": "the one", "email": "[email protected]", "name": "Mr Toto"},
{"reason": "right here, right now", "email": "[email protected]", "name": "Alexis"}
]'Run the script !
================Once you've done that, just run the script::
mass-email -t template-folder -d dataset.json
Or use it as a library
======================You might prefer to use this software as a library, in this case, it would
look like this::import mass_emailer
mass_emailer.send_emails(templates_folder="mail-template.tpl", dataset="dataset.json")