Command line tool to easily send emails through Mailgun.
- persistent configuration file
- mustache templates
- all options accessible through arguments and config file for easy automation and usage
- Running in Docker (preferred)
docker run --rm \
-v $(pwd)/config.yaml:/config.yaml:ro \
-v $(pwd)/templates:/templates:ro \
tekwrks/mailgun-cli:1.0.0 \
--help
- Building it locally
git clone https://github.com/tekwrks/mailgun-cli
cd mailgun-cli
make && make install
mailgun-cli --config=config.yaml
Accepts mustache variables from: (ascending priority)
- configuration YAML file in
variables
object - flags field in YAML configuration file (as a list under
flags
) - command line arguments as
key=value
config.yaml
---
domain: DOMAIN
apiKey: API-KEY
flags:
- --subject="Hey World"
- foo=bar
from: [email protected]
subject: Hello World
to:
- [email protected]
cc:
- [email protected]
- [email protected]
bcc:
plain:
engine: mustache
path: ./plain.mustache
html:
path: ./html.mustache
variables:
greeting: Hello
name: World
...
All options are accessible also directly from command line options. (And will override values from configuration file!)
Usage: mailgun-cli [OPTION ...] [VARIABLE=VALUE ...]
--domain=DOMAIN Mailgun DOMAIN
--api-key=API-KEY Mailgun API-KEY
--from=email sender email address
--subject=subject email subject
--to=to email addresses, comma separated
--cc=cc email addresses, comma separated
--bcc=bcc email addresses, comma separated
-c[config.yaml] --config[=config.yaml] yaml config file
--plain[=plain.mustache] plain text mustache template
--html[=html.mustache] plain text mustache template
-h --help Print this help message.
--version Print version.
MIT License