Giter VIP home page Giter VIP logo

watchmen-plugin-sendgrid's Introduction

watchmen-plugin-sendgird

A plugin for watchmen to send email notifications making use of SendGrid.

Templates

This plugin comes with default templates written in Handlebars for new outages and service back events. Each event has a body and subject template.

You can override templates by copying the included template folder into a new location and specifying this in your environment variables (see below).

Body templates must go in templates/body and subject templates in templates/subject

Their filenames should correspond to the watchmen event they're for. For example, templates/body/new-outage.hbs. The plugin will compile all templates when loaded and send email for any body template it loads. This means if you want to send an email for the latency-warning event, simply create a template at templates/body/latency-warning.hbs and restart watchmen.

{{service.name}} ({{service.url}}) is back online after the outage on {{date data.timestamp}}

Templates are passed a service object and a data object. The data object contains the second argument of the event, usually data on the current or last outage. See what the events get passed here: Creating Your Own Plugin

Environment variables

The following sample configures the Sendgrid information and specifies a custom template directory—overriding the default included templates as explained above.

WATCHMEN_SENDGRID_KEY='SENDGRID_API_KEY'
[email protected]
WATCHMEN_SENDGRID_TEMPLATE_DIRECTORY=/home/watchmen/templates

or

WATCHMEN_SENDGRID_USER='SENDGRID_USERNAME'
WATCHMEN_SENDGRID_PASSWORD='SENDGRID_PASSWORD'
[email protected]
WATCHMEN_SENDGRID_TEMPLATE_DIRECTORY=/home/watchmen/templates

watchmen-plugin-sendgrid's People

Contributors

lorranpego avatar

Watchers

James Cloos 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.