savsgio / microservice-email

Microservice for send emails

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

microservice-email

Build Status Go Report Card GitHub release

Microservice to send emails

System requirements

Installation

Download Go dependencies and build:

make

Install

make install

After, you can exec with

microservice-email

Optional arguments:

  • -log-level: Level of log that you want to show (default: info)
  • -config-file: Path of configuration file (default: /etc/microservice-email.yml)
  • -version: Print version of service

API:

This API only accept POST http request with below parameters in body:

Explanation (all are required):

  • to: List of emails of destiny
  • subject: Subject of email
  • content_type: Content type of email that it can be text/plain or text/html
  • body: Content of email

Example of request to send a email:

{
  "to": ["example_1@example.com", "example_2@example.com"],
  "subject": "Hi, my friend",
  "content_type": "text/html",
  "body": "<h1>This is the body of my Email in HTML format</h1>"
}

Docker

Dependencies

Build:

make docker_build

Run:

make docker_run

For Devs

Copy config/microservice-email.conf to config/microservice-email.dev.conf.yml (this file not tracked in Git), modify each config and exec:

make run

Note: If you want to use with Docker, make sure you have this rabbitmq configuration in config/microservice-email.dev.conf.yml:

...
rabbitmq:
  host: rabbitmq
  user: guest
  password: guest
  ...
...

Contributing

Feel free to contribute it or fork me... 😉

About

Microservice for send emails

License:GNU General Public License v3.0


Languages

Language:Go 76.4%Language:Makefile 13.1%Language:Dockerfile 9.0%Language:Shell 1.5%