Handles mail generation and sending (pw reset, welcome mail, etc)
Go to file
Philipp Dormann e7ad878fb9
continuous-integration/drone/push Build is failing Details
Merge pull request 'cleaned up mail texts for lfk 2023' (#16) from feature/simpler-mail-texts into main
Reviewed-on: #16
Reviewed-by: Nicolai Ort <info@nicolai-ort.com>
2023-02-01 13:55:30 +00:00
.vscode Added custom i18n ally framework 2021-03-02 16:30:09 +01:00
scripts Now generateing api key via eng_gen script 2021-03-02 16:57:46 +01:00
src Merge pull request 'cleaned up mail texts for lfk 2023' (#16) from feature/simpler-mail-texts into main 2023-02-01 13:55:30 +00:00
.drone.yml Revert "Now using more images powered by us 🚀🚀🚀" 2021-03-15 16:22:58 +01:00
.gitignore Not ignoring i18n ally framework any more 2021-03-02 16:29:59 +01:00
CHANGELOG.md 🧾New changelog file version [CI SKIP] [skip ci] 2023-01-31 13:00:29 +00:00
Dockerfile Dockerfile with cached images 🔥 2021-03-15 16:26:17 +01:00
LICENSE Initial commit 2021-03-01 16:13:03 +00:00
README.md Added env var docs to readme 2021-03-03 18:45:06 +01:00
docker-compose.yml Added dockerfile and docker-compose 2021-03-02 18:22:59 +01:00
jest.config.js Added jest config and first tests 2021-03-03 16:17:05 +01:00
licenses.md 📖New license file version [CI SKIP] [skip ci] 2023-01-31 13:01:06 +00:00
package.json 🚀Bumped version to v0.1.2 2021-04-15 20:00:56 +02:00
tsconfig.json Added basic files and depedencies 2021-03-01 17:18:18 +01:00

README.md

@lfk/mailer

Build Status

Handles mail generation and sending (pw reset, welcome mail, etc)

Dev Setup 🛠

Local dev setup

  1. Rename the .env.example file to .env (you can adjust app port and other settings, if needed) or generate a example env with yarn && yarn test:generate_env.
  2. Install Dependencies
    yarn
    
  3. Start the server
    yarn dev
    

Templates

The mailer uses html and plaintext templates to generate various mails. The templates are stored in src/templates by default.

We provide a set of default templates that we use for the "Lauf für Kaya!" charity run. We use handlebars for templateing utilizing i18next for translation - the i18n string format in the templates is : {{__ "string"}} You can provide your own templates by replacing the ones we provided before compiling the project or by simply mounting your custom templates into the docker container.

The server currently needs the following templates to work:

  • pw-reset.html
  • pw-reset.txt
  • test.html
  • test.txt
  • welcome_runner.html
  • welcome_runner.txt
Name Type Default Description
APP_PORT Number 4010 The port the backend server listens on. Is optional.
NODE_ENV String dev The apps env - influences debug info.
API_KEY String(min length: 64) Random generated string The api key you want to use for auth (query-param key), has to be at least 64 chars long.
API_URL String(url) "http://localhost:8080" The URL ponting to the base (root) of the lfk runner system.
MAIL_SERVER String(FQDN) None The mailserver (smtp) used to send mails via nodemailer.
MAIL_PORT Number 25 The mailserver's port (smtp).
MAIL_USER String None The username used to authenticate against the mailserver.
MAIL_PASSWORD String None The password used to authenticate against the mailserver.
MAIL_FROM String None The mail address that mails get sent from.
PRIVACY_URL String "/privacy" The url path that get's attached to the app url to link to the privacy page.
IMPRINT_URL String "/imprint" The url path that get's attached to the app url to link to the imprint page.
COPYRIGHT_OWNER String "LfK!" Text that gets inserted as the "copyright by" owner in the mails.
EVENT_NAME String "Testing 4 Kaya" The event's name - used to generate the mail text.
CONTACT_MAIL String(email) MAIL_FROM Contact mail address listed at the bottom of some mail templates.

Visual Studio Code

  • will be automatically recommended via ./vscode/extensions.json
  • we also provide a config for i18n-ally in the .vscode folder

Staging

Branches & Tags

  • vX.Y.Z: Release tags created from the main branch
    • The version numbers follow the semver standard
    • A new release tag automaticly triggers the release ci pipeline
  • main: Protected "release" branch
    • The latest tag of the docker image get's build from this
    • New releases get created as tags from this
  • dev: Current dev branch for merging the different feature branches and bugfixes
    • The dev tag of the docker image get's build from this
    • Only push minor changes to this branch!
    • To merge a feature branch into this please create a pull request
  • feature/xyz: Feature branches - nameing scheme: feature/issueid-title
  • bugfix/xyz: Branches for bugfixes - nameing scheme:bugfix/issueid-title