Coder Social home page Coder Social logo

web-msg-handler's Introduction

web-msg-handler

An API for handling messages from multiple website contact pages

Objective

Unify multiple web contact forms backends in a single instance, with a simple and modular configuration.

Senders available by default

  • Email
  • Telegram Bot

Dependencies

  • Node.js
  • [Optional] nodemailer (Node.js package): required for sending emails.

Additional build dependencies

  • Bash
  • Go
  • GoReleaser
  • TypeScript

Set up

Getting the software

You can either download a built release or build it yourself.

Installation

  • Extract the .tar.gz (recommended to extract it in a new directory).
  • Execute install.sh (working directory must be where the .tar.gz contents were extracted).

Public API

The API of web-msg-handler tries to be minimal. It consists only in a request and a response.

Request

The request must be made to the URL /<ID> where <ID> is the ID of the site defined in its config. This request must:

  • Have a valid ID
  • Be a POST request
  • Have a header with key "Content-Type" and value that contains "application/json"

The request must be a JSON that contains the following fields:

  • "name"
  • "mail"
  • "msg"
  • "g-recaptcha-response"

Response

The response is a JSON that contains the following fields:

  • "success": a boolean that indicates if the message was successfully send.
  • "error" (only when success==false): a string that indicates why it failed.

License

This software is licensed under MIT License. See LICENSE for more information.

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.