Skip to main content

Command line tool for managing Mandrill templates.

Project description

Plantain

A commandline tool for managing the lifecycle of Mandrill templates.

plantain.jpg

In short, plantain allows the user to manage their Mandril email templates from the commandline, perhaps as part of their configuration management system (eg Salt, Ansible, cfengine, Chef, Puppet, etc).

Install

$ pip install plantain

or:

$ sudo python setup.py install

Notes

Note: Plantain used to be called banana, until it turned out that someone else already had banana in the cheese shop! For backward comparability plantain installs a plantain and for legacy support, a banana binary.

Setup

plantain expects each template to consist of three files: an HTML file (.html) for the HTML fork of the email to be sent, a text file (.txt) for the text fork, and a configfile (.cfg) for the metadata aspects of the template (sending address, Subject: header etc). eg:

account_expired.cfg
account_expired.html
account_expired.txt

A sample configfile might read:

from_name = YourCompany
from_email = robot@yourcompany.com
subject = Account Expiration

The keys in the configfile match the keys used by the Mandrill API: https://mandrillapp.com/api/docs/

Note that for fields which are lists, such as labels, you must put a comma after the first item if there’s only one item in the list for it to be recognised as a list (otherwise the list is the list of characters in the token):

labels = foo,

Usage

$ plantain -h
usage: plantain [-h] -k KEY -t TEMPLATE -a ACTION [-p] [-q] [-v]

Manage and deploy Mandrill templates.

optional arguments:
  -h, --help            show this help message and exit
  -k KEY, --key KEY     Mandrill API key.
  -t TEMPLATE, --template TEMPLATE
                        Template to manipulate.
  -a ACTION, --action ACTION
                        Action to perform: ['addinfo', 'update',
                        'publish', 'delete', 'list', 'time_series']
  -p, --publish         Auto-publish (for add and update).
  -q, --quiet           Suppress normal output.
  -v, --verbose         Output results and operations.

Examples

Example call to add a new template to Mandrill called “foo_bar”:

$ plantain -k AbbbcdeDeAdBeeFGaFFPA -t foo_bar -a add

Note that this will not “publish” the template. To do that:

$ plantain -k AbbbcdeDeAdBeeFGaFFPA -t foo_bar -a publish

Or you can publish at the same time you add or update the template:

$ plantain -k AbbbcdeDeAdBeeFGaFFPA -t foo_bar -a update -p

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

plantain-0.2.post1.tar.gz (55.7 kB view details)

Uploaded Source

File details

Details for the file plantain-0.2.post1.tar.gz.

File metadata

  • Download URL: plantain-0.2.post1.tar.gz
  • Upload date:
  • Size: 55.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for plantain-0.2.post1.tar.gz
Algorithm Hash digest
SHA256 472afed6356c4c066b1e0d50eb1bb215756f5db57bf9326a275296ebba93ab9c
MD5 6fa3743dfb208e4d37cb3eafc6c76066
BLAKE2b-256 187caa3915150f6650d11b57e4342ed0c64de9ac55c8067e9f3a650d4329de23

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page