mailer/README.md

51 lines
1.3 KiB
Markdown

# USAGE
As all programs from `Baguette` repositories, a `-h` option is available for the program.
```Bash
mailer -h
```
### Sending a mail
```Bash
# One-shot email transfer.
# mailer send <template> <email>
login=mypseudo token=aabbccdd mailer send activation-email test@example.com
```
### Configuration
As all programs from `Baguette` repositories, a configuration file either in the `$XDG_CONFIG_HOME/baguette/` (first guess) or in the `/etc/baguette/` directory can be used.
Here an exhaustive example:
```YAML
# ~/.config/baguette/mailer.yml
# SMTPd configuration.
smtpd_host: localhost
smtpd_port: 25
# Where to find templates, if not in the defaut directory (/etc/baguette/mailer/templates/).
template_directory: /path/to/mailer/templates
# Configuration for each template.
templates:
# Template name, associated to the mail configuration: "from" and "subject" headers.
mail-activation-fr:
from: no-reply@example.com
subject: Account activation on the example.com website
mail-recovery-fr:
from: no-reply@example.com
subject: Mail recovery for the example.com website
```
### Templates
Templates:
- are in the [Crinja format][crinja] (a Jinja derivative)
- located by default in `/etc/baguette/mailer/templates`
[crinja]: https://github.com/straight-shoota/crinja