Sign inSign up

lotuxpunk/hermes

By lotuxpunk

•Updated about 2 months ago

Mailer micro-service for vandeas

Image
Developer tools
0

2.6K

lotuxpunk/hermes repository overview

⁠Hermes

Mailer micro-service for vandeas

⁠Table of content

⁠Environment Variables

To run this project, you will need to add the following environment variables

  • CONTACT_FORM_CONFIGS_FOLDER
  • MAIL_CONFIGS_FOLDER
  • TEMPLATES_FOLDER
  • GOOGLE_RECAPTCHA_SECRET
  • SENDGRID_API_KEY

⁠Documentation

⁠Contact Form
⁠Example of CONTACT_FORM_CONFIGS_FOLDER configuration files
{
    "id": "UUID",
    "dailyLimit": 10,
    "destination": "[email protected]",
    "sender": "[email protected]",
    "threshold": 0.5, // Recapthca score thresold
    "lang": "fr", // ISO 639-1
    "subjectTemplate": "New mail from {{form.firstName}}"
}

Filename does not have to respect any convention.

⁠Mail config
⁠Example of MAIL_CONFIGS_FOLDER configuration files
{
    "id": "UUID",
    "sender": "[email protected]",
    "subjectTemplate": "New mail from {{form.firstName}}"
}
⁠Mail template

Filename should be {{UUID}}.hbs (same UUID as the id field in the Contact Form or Mail config)

⁠API Reference
⁠Send contact form using contact form configuration

POST /v1/mail/contact

⁠Body
AttributeTypeDescription
idstringRequired. Your contact form config id
fullNamestringRequired Full name of the person that sent the form
emailstringRequired Email of the person that sent the form
contentstringRequired Content of the message
recaptchaTokenstringRequired Result token/secret of recaptcha
⁠Send mail using mail configuration

POST /v1/mail

⁠Body
AttributeTypeDescription
idstringRequired. Your mail config id
emailstringRequired Email of the person to sent the mail to
attributesMap<string, string> / JSON ObjectRequired Attributes to hydrate the mail template

⁠Roadmap

  • Better templating system (currently stored in /resources/templates)
  • Endpoint to send email
  • Watch and reload configuration files and templates

Tag summary

Content type

Image

Digest

sha256:553c9b48c…

Size

180.3 MB

Last updated

about 2 months ago

docker pull lotuxpunk/hermes