-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
63 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,12 +12,73 @@ Still, just to be safe, I explicitly discourage using `bart` for mission-critica | |
|
||
## Installation | ||
|
||
### From source on Linux | ||
### From source | ||
|
||
``` | ||
$ make install | ||
``` | ||
|
||
### Binaries | ||
|
||
You can get them from GitHub releases. | ||
You can get them from [GitHub releases](https://github.com/mp4096/bart/releases). | ||
|
||
|
||
## Usage example | ||
|
||
You want to send an HTML email stored as a [Mustache template](https://mustache.github.io/) in `template.mustache`. | ||
Your configuration (see below) is defined in `config.bart.yml`. | ||
|
||
To preview the rendered emails, call `bart` without the send `-s` flag: | ||
|
||
``` | ||
$ bart -m template.mustache -c config.bart.yml | ||
Hello, Jane Doe | ||
Send flag not set: opening preview in "chromium-browser" | ||
Send flag not set: opening preview in "chromium-browser" | ||
``` | ||
|
||
To send the email, add the send flag `-s`: | ||
|
||
``` | ||
$ bart -m template.mustache -c config.bart.yml -s | ||
Hello, Jane Doe | ||
Please enter your credentials for "smtpserver.xyz.com" | ||
Login: janedoe | ||
Password: | ||
Will send to [[email protected] [email protected]] | ||
Will send to [[email protected] [email protected]] | ||
``` | ||
|
||
Since this email will not appear in your provider's `Sent` folder, | ||
`bart` will send you a BCC copy. | ||
|
||
For help, call `bart -h`. | ||
|
||
## How to configure | ||
|
||
Here's an example config file: | ||
|
||
```yaml | ||
author: | ||
name: Jane Doe | ||
email: [email protected] | ||
browser: chromium-browser | ||
|
||
email_server: | ||
hostname: smtpserver.xyz.com | ||
port: 123 | ||
|
||
global_context: | ||
subject: Global subject | ||
|
||
recipients: | ||
[email protected]: | ||
salutation: Hi John | ||
subject: Local subject, overrides global one | ||
[email protected]: | ||
salutation: Hello Max | ||
``` | ||
Basically, `recipients` is a hashmap keyed by recipient email addresses; | ||
the values are local contexts specific for each recipient. | ||
Notice that local context overrides global one! |