Public | Automated Build

Last pushed: 2 years ago
Short Description
Short description is empty for this repo.
Full Description

mailserver

a simple microservice to deliver emails through sendgrid api

Why?

  • Centralized config (just one place to periodically change the pwd - or in
    case of incidents)
  • Avoiding multiple ways of sending mail in multiple microservices
  • Docker'ized (if you want)

Usage

The "simple" way

Building
$ go get github.com/sendgrid/sendgrid-go
$ go build
Running
$ SG_API_USER=username SG_API_KEY=password ./mailserver

With Docker

$ docker build -t mailserver .
$ docker run -d \
  -p 3000:3000 \
  -e SG_API_USER=user \
  -e SG_API_KEY=password \
  mailserver

Testing (using cURL)

$ curl \
  -H "from: me@somewhere.com" \
  -H "to: someone@somewhere.com" \
  -H "subject: Sending an email" \
  -d "<h1>some html</h1><p>or plain text</p>" \
  http://localhost:3000/send
Docker Pull Command
Owner
caarlos0
Source Repository