Creating drafts from a template by replacing variables with values.
This is a
bundle
for MailMate. It allows the creation of a set of
emails from a template by assigning variables of the form ${var}
to values.
The template is written as an email and stored as a draft. The bundle creates
instances of emails and saves them as drafts as well.
Here is an example. Assume that you want to sent an email of the form
To: ${to}
Hi ${firstname},
It's nice to write to you again. I hope you are well.
Your number is ${number}.
Best,
Michael
to Adam at foo.com and Eve at bar.org. Store the above template as a
draft and create a tab-separated-value file named variables.txt
with contents
firstname to number
Adam [email protected] 42
Eve [email protected] 17
at ~/Library/Application Support/MailMate/Bundles/draftstemplate.mmbundle
In MailMate, select Command | Drafts Template | Create Drafts from
Template. The resulting emails will be stored in the Drafts
folder.
This generates two draft emails:
To: [email protected]
Hi Adam,
It's nice to write to you again. I hope you are well.
Your number is 42.
Best,
Michael
and
To: [email protected]
Hi Eve,
It's nice to write to you again. I hope you are well.
Your number is 17.
Best,
Michael
The documentation of the bundle mechanism is available here.
Depending on your Python installation you may need to change the path in
Support/bin/helper.py
to point to the python3 interpreter.