notifier

command module
v0.0.0-...-418df79 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2021 License: MIT Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Introduction

A multipurpose notification library to send mail, text, slack, push, telegram etc. developed in Go

Design Goals

  • Should be Simple and Easy to build hence Go programming language is selected
  • Deployment shouod be xcopy and cross platform, Go meets this out of the box
  • Should be serverless lambdas function but should impose any AWS or Azure style coding. Apex Gateway solves this.
  • CI/CD should be out of the box without writing any code like Github actions, Lambda deployment etc. Netlify takes care of this
  • Log analysis and debug capabilities - suppoered using custom Go logger which Netlify exposes thru GUI.
  • Maintenance cost should be $0. Yes, everything should be Free
Pre-requisites
  • Should have Go installed in your local development environment
  • Optional netlify account to deploy the golang api's as serverless functions
  • Optional netlify CLI
  • Optional if you want to send HTML formatted email using mailgun template. I used Maizzle to build HTML emails with Tailwind CSS https://maizzle.com/
  • mailgun account as the notify (sendmail) api is built using mailgun
  • VSCode Editor or Gitpod online VSCode editor 50 hours per month free plan
Local Development

Clone repository.

git clone https://github.com/senthilsweb/notifier.git

Local build (Mac OS)

go build

Local Run

./notifier -p "3000"
Available REST API Endpoints

The following APIs implemented and readily available to use in your projects

https://zybes.netlify.app/api

Request Endpoints Functionality
POST https://zybes.netlify.app/api/notify/mailgun Send email
GET https://zybes.netlify.app/api/ping Health check

Payload for https://zybes.netlify.app/api/notify/mailgun

{
    "message": {
        "subject": "This is subject",
        "body": "This is body",
        "template": "welcome_email",
        "recipient": "name <your email@gmail.com>",
        "payload": {"name":"John Smith"}
    },
    "MAILGUN_DOMAIN": "your domain",
    "MAILGUN_KEY": "your key",
    "EMAIL_SENDER": "Mailgun Sandbox <your sender>"
}
Netlify Deployment

Refer the following documentaion and blog post to host the server (and optional Single Page Application) at Netlify

Key Frameworks and Libraries used
  • github.com/apex/gateway
  • github.com/gin-gonic/gin
  • github.com/mailgun/mailgun-go/v4
  • github.com/sirupsen/logrus
  • github.com/spf13/viper
  • github.com/tidwall/gjson

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg
cetak
Package cetak helps you generate Word document (.docx) from a template.
Package cetak helps you generate Word document (.docx) from a template.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址