Coder Social home page Coder Social logo

gfw-mail-api's Introduction

Global Forest Watch Mail API

Build Status Test Coverage

This repository is the microservice that send the emails.

  1. Getting Started

Getting Started

OS X

First, make sure that you have the API gateway running locally.

We're using Docker which, luckily for you, means that getting the application running locally should be fairly painless. First, make sure that you have Docker Compose installed on your machine.

If you've not used Docker before, you may need to set up some defaults:

docker-machine create --driver virtualbox default
docker-machine start default
eval $(docker-machine env default)

Now we're ready to actually get the application running:

git clone https://github.com/Vizzuality/gfw-ogr-api.git
cd gfw-mail-api
yarn install
yarn start

Configuration

It is necessary to define these environment variables:

  • QUEUE_URL => Redis service URL
  • QUEUE_NAME => Name of the redis pub/sub queue where messages can be found
  • NODE_ENV => Environment (prod, staging, dev)
  • SPARKPOST_API_KEY => Sparkpost api key to send emails
  • SPARKPOST_LINK_TRACKING_ENABLED => If set to "false", Sparkpost will not enable tracking of opened emails or clicked links

Email templates

This microservice uses Sparkpost to send emails, and specifically Email Templates as a way to streamline mass email sending. Email Templates are stored in Sparkpost itself, and referenced by name when sending emails based on said templates.

For ease of maintainability, Sparkpost Email templates are kept in this project, inside the email-templates folder, as part of a Terraform project. When modifying said templates, be sure to do so in the files included in this project, and after running the terraform apply (or equivalent) command to apply your changes. If you want, for ease of testing and development, you can still make temporary changes directly on Sparkpost, but be sure to port any changes you want to keep back into the code in this project.

gfw-mail-api's People

Contributors

archelogos avatar dependabot-preview[bot] avatar dependabot[bot] avatar enriquecornejo avatar rrequero avatar tiagojsag avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.