GithubHelp home page GithubHelp logo

lukibsubekti / notifier Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 94 KB

Free tool to send notifications or messages to a variety of channels

JavaScript 2.90% Dockerfile 1.41% TypeScript 94.71% HTML 0.98%

notifier's Introduction

About

Notifier is a free tool to send notifications or messages to a variety of channels. The message is template-based. We store the template in Notifier then send a request to Notifier with matching payload to populate the message content.

Features

  • Send email through SMPT
  • Send email through Amazon SES using API key
  • Send email through Brevo using API key
  • Send message to Whatsapp
  • Send message to Telegram
  • Send message to Slack

Setup

  1. Create templates.
    Templates are stored in /templates directory. We can create a template inside subdirectories under /templates. It is recommended we have the template with both html and txt format as the email sender function will try to render both formats. For example, we have /templates/en/sample.hello.html and /templates/en/sample.hello.txt. Then, in the HTPP request body we can select the template by setting the template field to en/sample.hello.

  2. Create and configure .env file based on .env.sample.

  3. Install dependencies.

    pnpm install

Running the app

# development
$ pnpm run start

# watch mode
$ pnpm run start:dev

# production mode
$ pnpm run start:prod

Run Using Docker

  1. An example of docker-compose.yaml configuration is available here.

  2. Configure your .env file based on .env.sample.

  3. Bind your templates directory to /app/templates directory in the container.

Send Request & The Parameters

To send an email, send a POST request to http://<your_host>:<your_port>/send. The body parameters are as follows.

  • is_sync: boolean.
    Default false. Setting mode to synchronous or asynchronous. If the client wants to receive the email sending result, it can be set to true (synchronous).
  • method: “smtp” | “ses” | “brevo”.
    Default “smtp”.
  • to_email: string.
    Receiver's email address.
  • to_name: string.
    Receiver's name.
  • template: string.
    It is required if the method is not “brevo”. It is not required if the method is “brevo” and brevo_template is not empty.
  • subject: string.
    Subject of email.
  • payload: object.
    The content depends on the target template.
  • brevo_template: string or number.
    Template number in Brevo. It can be used if the method is “brevo”.

For example:

{
    "is_sync": true,
    "to_email": "[email protected]",
    "to_name": "Luki",
    "subject": "Registration Success",
    "payload": { "fullName": "Luki", "url": "http://google.com" },
    "method": "smtp",
    "template": "en/sample.hello"
}

ToDo

  • Schedule notification
  • Send notification status through webhook
  • Error logging

License

Notifier is MIT licensed.

notifier's People

Contributors

lukibsubekti avatar

Watchers

 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.