Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pythonindia/pyconindia
PyCon India
https://github.com/pythonindia/pyconindia
Last synced: 7 days ago
JSON representation
PyCon India
- Host: GitHub
- URL: https://github.com/pythonindia/pyconindia
- Owner: pythonindia
- Created: 2014-02-10T17:00:13.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-08-25T10:14:34.000Z (about 10 years ago)
- Last Synced: 2024-03-25T22:16:54.904Z (8 months ago)
- Language: Python
- Size: 1 MB
- Stars: 5
- Watchers: 10
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
Publicity Mail Usage
====================The command line syntax of the tool is as given below.
The ``-c``, ``-s`` and ``-t`` options are mandatory::usage: publicitymail [-h] [-c CONFIG] [-s SUBJECT] [-t TEMPLATE]
optional arguments:
-h, --help show this help message and exit
-c CONFIG, --config CONFIG
Configuration file
-s SUBJECT, --subject SUBJECT
Mail subject
-t TEMPLATE, --template TEMPLATE
Mail body templateAn example configuration file is available at ``conf/example1.cfg``.
An example template file is available at ``conf/example1.template``.Any value inside the configuration can be overridden using a specially
formatted environment variable. The environment variable name should
be in this format: PUBLICITY__For example, to override the value of ``password`` inside the ``main`` section,
set an environment variable named ``PUBLICITY_MAIN_PASSWORD`` like this::export PUBLICITY_MAIN_PASSWORD=the-real-password
Once the configuration file and template is ready, a mail can be send like
this::publicitymail -c /path/to/config.cfg -s "The mail subject" -t /path/to/some.template
It is recommended to use separate configuration and template for different mails.
The configuration
-----------------This is example configuration::
[main]
username = [email protected]
password = this-is-wrong-password
from_email = [email protected]
from_name = Baiju Muthukadan[to_addresses]
[email protected] = Bangalore
...[[email protected]]
key1 = value1
...The ``main`` section has the ``username`` and ``password`` for the Gmail account.
It also contains the email and name from whom the mail is sending.The ``to_addresses`` section lists all the recipients email address and name.
There should be separate sections for each address to include user specific
values in the mail. The values given in the email sections can be used in
template file using the Jinja2 macro syntax. In the above example,
the ``value`` corresponding to ``key1`` can be used in the mail like this:
``{{ key1 }}``.To comment any line, add ``#`` character at the beginning of that
line. More specifically, the ``#`` should be the first character in
that line.The template file use the Jinja2 template language.