Skip to content

Creating drafts from a template by replacing variables with values.

License

Notifications You must be signed in to change notification settings

mirohs/draftstemplate.mmbundle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

draftstemplate.mmbundle

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	adam@foo.com	42
Eve	eve@bar.org	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: adam@foo.com

Hi Adam,

It's nice to write to you again. I hope you are well.
Your number is 42.

Best,
Michael

and

To: eve@bar.org

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.

About

Creating drafts from a template by replacing variables with values.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages