Mailer micro-service for vandeas
To run this project, you will need to add the following environment variables
CONTACT_FORM_CONFIGS_FOLDER: An existing folder in your file system where the contact form configs will be stored.MAIL_CONFIGS_FOLDER: An existing folder in your file system where the email configs will be stored.TEMPLATES_FOLDER: An existing folder in your file system where the email templates will be stored.GOOGLE_RECAPTCHA_SECRET: A Google ReCaptcha secret (required only when using Google ReCaptcha in contact forms).USE_MAIL_QUEUE: (Optional, default:true) Enable queue-based email sending with rate limiting.MAIL_RATE_LIMIT: (Optional, default:10) Maximum number of emails to send per second.
See .env.example for a complete configuration template.
Hermes includes a built-in queue system with rate limiting for email sending. See MAIL_QUEUE_SYSTEM.md for detailed documentation.
Hermes now includes a Compose Multiplatform desktop application for managing mail templates and configurations via SSH!
- Remote Management: Connect to your server via SSH and manage files remotely
- Template Editor: Browse, edit, create, and delete mail templates (.hbs files)
- Config Management: Manage mail and contact form configuration files (JSON)
- Modern UI: Material 3 design with intuitive tabbed navigation
- Persistent Settings: Saves your SSH connection settings locally
# Run the desktop application
./gradlew desktop:run
# Build native installer
./gradlew desktop:packageDistributionForCurrentOSFor detailed documentation, see desktop/README.md.
SendgridRemoved due to lack of support for batch emails requests- Resend
- Custom SMTP server, that can be configured in the email & contact form configs
Contact forms support captcha validation with the following providers:
- Google ReCaptcha - Requires
GOOGLE_RECAPTCHA_SECRETenvironment variable - Kerberus - Alternative captcha provider
Resend-based config
{
"id": "UUID",
"dailyLimit": 10,
"destination": "john@example.com",
"sender": "doe@example.com",
"threshold": 0.5, // ReCaptcha score threshold
"lang": "fr", // ISO 639-1
"subjectTemplate": "New mail from {{form.firstName}}",
"provider": "RESEND",
"apiKey": "<YOUR_RESEND_API_KEY>"
}SMTP-based config
{
"id": "UUID",
"dailyLimit": 10,
"destination": "john@example.com",
"sender": "doe@example.com",
"threshold": 0.5, // ReCaptcha score threshold
"lang": "fr", // ISO 639-1
"subjectTemplate": "New mail from {{form.firstName}}",
"provider": "SMTP",
"username": "<SMTP_USERNAME>",
"password": "<SMTP_PASSWORD>",
"smtpHost": "<SMTP_SERVER_IP>",
"smtpPort": "<SMTP_SERVER_PORT>"
}Filename does not have to respect any convention.
Resend-based config
{
"id": "UUID",
"sender": "no-reply@example.com",
"subjectTemplate": "New mail from {{form.firstName}}",
"provider": "RESEND",
"apiKey": "<YOUR_RESEND_API_KEY>"
}SMTP-based config
{
"id": "UUID",
"sender": "no-reply@example.com",
"subjectTemplate": "New mail from {{form.firstName}}",
"provider": "SMTP",
"username": "<SMTP_USERNAME>",
"password": "<SMTP_PASSWORD>",
"smtpHost": "<SMTP_SERVER_IP>",
"smtpPort": "<SMTP_SERVER_PORT>"
}Filename should be {{UUID}}.hbs (same UUID as the id field in the Contact Form or Mail config)
POST /v1/mail/contact
| Attribute | Type | Description |
|---|---|---|
id |
string |
Required. Your contact form config id |
fullName |
string |
Required Full name of the person that sent the form |
email |
string |
Required Email of the person that sent the form |
content |
string |
Required Content of the message |
recaptchaToken |
string |
Required Result token/secret of recaptcha |
POST /v1/mail
| Attribute | Type | Description |
|---|---|---|
id |
string |
Required. Your mail config id |
email |
string |
Required Email of the person to sent the mail to |
attributes |
Map<string, string> / JSON Object |
Required Attributes to hydrate the mail template |
POST /v1/mail/batch
| Attribute | Type | Description |
|---|---|---|
mails |
Array<Mail> |
Required. Array of mails to send |
[
{
"id": "UUID", // Mail config id
"email": "johndoe@example.com",
"attributes": {
"firstName": "John",
"lastName": "Doe"
}
}
]- Better templating system (currently stored in /resources/templates)
- Endpoint to send email
- Desktop application to manage templates and configs via SSH
- Queue system with rate limiting for email sending
- Watch and reload configuration files and templates