Skip to content

serlo/notification-mail-service

Repository files navigation

serlo.org - Notification Mail Service

Micro-service that notifies users by email about last events they subscribed to.

Getting started

Requirements:

Preparations

  • cd to serlo/api.serlo.org and yarn start
  • cd to serlo/local-dev-env and yarn start:without:api

Developing

After cloning this repo and cd into it:

  1. yarn for installing dependencies.
  2. yarn start for running local testing database and fake email client. 1
  3. yarn notify
  4. Navigate to the http://localhost:4444/ to see your local mail client. 1
  5. Go to serlo/local-dev-env and hit yarn mysql:rollback to roll back the database changes.
  6. When you are done, yarn stop.

Using API

For now this service uses info from API as an easy way of enriching the notification email body. If you change any graphql query, use yarn codegen.

Developing templates

Run yarn template.

Running tests

Run yarn test.

Releasing a new version

We release new versions by hand. Run the following commands:

docker build . -t eu.gcr.io/serlo-shared/notification-mail:${new version}
docker push eu.gcr.io/serlo-shared/notification-mail:${new version}

Helpful Info

Use yarn mysql to prompt to the cli of your local database.
Use yarn format for linting and formatting.

Footnotes

  1. You don't need this step if you bring your own database, smtp server and/or email client. In that case adapt the .env and maybe the docker-compose.yml. 2