From 9cb100c7c43b082263f4f58c82554c85d7be8494 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Wed, 3 Mar 2021 18:36:34 +0100 Subject: [PATCH 1/3] Added more info to the readme ref #3 --- README.md | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3e83512..18e72c1 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,58 @@ # mailer -Handles mail generation and sending (pw reset, welcome mail, etc) \ No newline at end of file +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 + ```bash + yarn + ``` +3. Start the server + ```bash + 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](https://lauf-fuer-kaya.de). +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 + + +## Recommended Editor + +[Visual Studio Code](https://code.visualstudio.com/) + +### Recommended Extensions + +* 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` \ No newline at end of file From e48f830c08900a9c9e4451d16a25f3ef3d9485e4 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Wed, 3 Mar 2021 18:37:50 +0100 Subject: [PATCH 2/3] Added ci status ref #3 --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 18e72c1..a38a752 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # mailer +[![Build Status](https://ci.odit.services/api/badges/lfk/mailer/status.svg?ref=refs/heads/main)](https://ci.odit.services/lfk/mailer) Handles mail generation and sending (pw reset, welcome mail, etc) From 5314100065f24cb0902c1ba207b880016abd300e Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Wed, 3 Mar 2021 18:45:06 +0100 Subject: [PATCH 3/3] Added env var docs to readme ref #3 --- README.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a38a752..6c6ca2c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# mailer +# @lfk/mailer [![Build Status](https://ci.odit.services/api/badges/lfk/mailer/status.svg?ref=refs/heads/main)](https://ci.odit.services/lfk/mailer) Handles mail generation and sending (pw reset, welcome mail, etc) @@ -16,7 +16,6 @@ Handles mail generation and sending (pw reset, welcome mail, etc) yarn dev ``` - ## Templates > The mailer uses html and plaintext templates to generate various mails. > The templates are stored in src/templates by default. @@ -33,6 +32,22 @@ The server currently needs the following templates to work: * 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. ## Recommended Editor