Microservice to send emails
Download Go dependencies and build:
makeInstall
make installAfter, you can exec with
microservice-emailOptional 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
This API only accept POST http request with below parameters in body:
Explanation (all are required):
to: List of emails of destinysubject: Subject of emailcontent_type: Content type of email that it can be text/plain or text/htmlbody: Content of email
Example of request to send a email:
{
"to": ["[email protected]", "[email protected]"],
"subject": "Hi, my friend",
"content_type": "text/html",
"body": "<h1>This is the body of my Email in HTML format</h1>"
}- Docker
- Docker-compose _Recommended to install with
pip3(python3).
Build:
make docker_buildRun:
make docker_runCopy config/microservice-email.conf to config/microservice-email.dev.conf.yml (this file not tracked in Git), modify each config and exec:
make runNote: 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
...
...Feel free to contribute it or fork me... 😉