Skip to content

Commit

Permalink
Add some explanation to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mp4096 committed Dec 24, 2017
1 parent ca53ce1 commit 7b04b60
Showing 1 changed file with 63 additions and 2 deletions.
65 changes: 63 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!

0 comments on commit 7b04b60

Please sign in to comment.