Skip to content

Micro mailing service using Postmark API & Consul runtime config

License

Notifications You must be signed in to change notification settings

suicidegang/mail-srv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Report Card Build Status

Mail-srv

Mail-srv is a microservice used to send & track emails using Postmark API. Built for Golang micro.mu

Getting started

  1. Install Consul

    Consul is the default registry/discovery for go-micro apps. It's however pluggable. https://www.consul.io/intro/getting-started/install.html

  2. Run Consul

    $ consul agent -server -bootstrap-expect 1 -data-dir /tmp/consul
    
  3. Setup config values in Consul KV

    mail/server-token Your postmark server token.

    mail/templates/{template-alias} Template aliases "KV" folder

  4. Download and start the service

    go get github.com/suicidegang/mail-srv
    mail-srv

The API

Mailing server implements the following RPC Methods

Mailing

  • SendTemplate

Mailing.SendTemplate

$ micro query sg.micro.srv.mail Mailing.SendTemplate '{
	"template": "user.signup",
	"variables": {"base_url": "https://spartangeek.com"},
	"message": {
		"from": "pedidos@spartangeek.com", 
		"fromName": "Lic. Alberto", 
		"to": "fernandez14@outlook.com", 
		"toName": "Nobody"
	}
}'
{
	"messageID": "bdff86f7-75d4-46b7-88f3-93b53a5b8448"
}

About

Micro mailing service using Postmark API & Consul runtime config

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published