https://github.com/dk26/osa-mailer
Send dynamic and sophisticated E-mails using Smart Templates
https://github.com/dk26/osa-mailer
email-sender sendmail template-engine
Last synced: 6 months ago
JSON representation
Send dynamic and sophisticated E-mails using Smart Templates
- Host: GitHub
- URL: https://github.com/dk26/osa-mailer
- Owner: DK26
- License: mit
- Created: 2022-06-22T18:50:31.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-07-02T16:13:40.000Z (6 months ago)
- Last Synced: 2025-07-02T17:22:44.327Z (6 months ago)
- Topics: email-sender, sendmail, template-engine
- Language: Rust
- Homepage: https://dk26.github.io/osa-mailer/
- Size: 3.73 MB
- Stars: 3
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Roadmap: docs/roadmap-community-vision.html
Awesome Lists containing this project
README

**Send dynamic and sophisticated E-mails using Smart Templates**
[Guidebook](https://dk26.github.io/osa-mailer/) |
[Discussions](https://github.com/DK26/osa-mailer/discussions)
[](https://github.com/DK26/osa-mailer/actions/workflows/general.yml)
[](https://github.com/DK26/osa-mailer/actions/workflows/security-audit.yml)
[](https://github.com/DK26/osa-mailer/actions/workflows/pages/pages-build-deployment)
[Download Alpha 3 (i686-pc-windows)](https://github.com/DK26/osa-mailer/releases/tag/alpha-3)
## Features
- Currently supports 3 template engines: `tera`, `handlebars` and `liquid`
- Automatically attaches all your HTML resources to the SMTP message
- Provides you the ability to aggregate multiple E-mails of the same subject and recipients, into a single E-mail with accumulated context
- Supports multiple SMTP connection types: `NOAUTH`, `TLS` and `STARTTLS`
## Supported Template Engines
| Name | Short / File Extension | Version | Guide / Manual / Tutorial |
| ---------- | ---------------------- | ------- | ------------------------------------------------------------- |
| Tera | `tera` | v1.18.1 | |
| Handlebars | `hbs` | v4.3.6 | |
| Liquid | `liq` | v0.26.1 | |
## How it Works
OSA-Mailer uses asynchronous approach for sending E-mails, sacrificing realtime notifications in favour of increasing feature capabilities.
This enables OSA-Mailer the merge of multiple E-mails context of the same recipients, craft beautiful and sophisticated E-mails, using rendering engines, and some other future ideas that are on the table (such as timed or conditioned E-mail messages). It also enables resending E-mails in case of an error, or using other mitigation methods.
### Workflow
1. An external tool is creating and writing a formatted E-mail send requests (JSON file) into the `outbox` directory (refer to the `send_email_request` python scripts for examples)
2. The OSA-Mailer service is pulling every X configured seconds for new E-mail send requests found within the `outbox` directory
3. OSA-Mailer calculates an E-mail ID for each request base-off its `email` section and effectively merging dynamic `context` values
4. It then composes an SMTP message using the provided HTML template, rendering it with the chosen rendering engine against the merged context, allowing for a dynamic E-mail creation, while automatically loading all related resources (images) used within that HTML template
5. It sends out the final SMTP E-mail message, using the configurations within the `osa_mailer.cmd` file
## Quick Template Engines Guide
Tera (click to expand)
* Guide:
* Version: **v1.18.1**
* Repository:
* Alternatives: `Jinja2`, `Django`, `Liquid`, `Twig`
A highly advanced, capable and secure by default; rendering engine that follows the OWASP Top 10 guidelines.
A good alternative choice if you are used to template engines such as `Jinja2`, `Django`, `Liquid` or `Twig`. Originated in the Rust programming language.
Handlebars (click to expand)
* Guide:
* Version: **v4.3.6**
* Repository:
* Alternatives: `Mustache`
A highly popular rendering engine that has been implemented across many programming languages. Considered to be somewhat more limited in features compared to the other engines. Originated in the Javascript programming language.
Liquid (click to expand)
* Guide:
* Version: **v0.26.1**
* Repository:
* Alternatives: `smarty`
A highly advanced, capable and senior rendering engine, offering some optional security capabilities. A good alternative choice if you are used to the `smarty` template engine. Originated in the Ruby programming language.
## Template Design & Preview
Try the [`rendit` CLI tool](https://github.com/DK26/rendit)
## Prototype Note
This is still an MVP (Minimal Viable Product) and there is still work to be done and features to be added. Features may be added or removed later with no notice (but typically documented in the changelog notes of each release)
## License
MIT