https://github.com/savsgio/microservice-email
Microservice for send emails
https://github.com/savsgio/microservice-email
docker emails go microservice rabbitmq
Last synced: 2 months ago
JSON representation
Microservice for send emails
- Host: GitHub
- URL: https://github.com/savsgio/microservice-email
- Owner: savsgio
- License: gpl-3.0
- Archived: true
- Created: 2018-01-09T15:22:18.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2021-01-18T08:40:38.000Z (about 5 years ago)
- Last Synced: 2024-06-20T16:33:32.635Z (almost 2 years ago)
- Topics: docker, emails, go, microservice, rabbitmq
- Language: Go
- Size: 71.3 KB
- Stars: 27
- Watchers: 4
- Forks: 9
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# microservice-email
[](https://travis-ci.org/savsgio/microservice-email)
[](https://goreportcard.com/report/github.com/savsgio/microservice-email)
[](https://github.com/savsgio/microservice-email/releases)
Microservice to send emails
### System requirements
- [Go](https://golang.org/dl/) (>= 1.12)
- [RabbitMQ](https://www.rabbitmq.com/)
- make
## Installation
Download Go dependencies and build:
```bash
make
```
Install
```bash
make install
```
After, you can exec with
```bash
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:
```json
{
"to": ["example_1@example.com", "example_2@example.com"],
"subject": "Hi, my friend",
"content_type": "text/html",
"body": "
This is the body of my Email in HTML format
"
}
```
## Docker
### Dependencies
- [Docker](https://www.docker.com/)
- [Docker-compose](https://docs.docker.com/compose/) \_Recommended to install with `pip3` (python3).
Build:
```bash
make docker_build
```
Run:
```bash
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:
```bash
make run
```
**_Note:_** If you want to use with Docker, make sure you have this rabbitmq configuration in `config/microservice-email.dev.conf.yml`:
```yaml
...
rabbitmq:
host: rabbitmq
user: guest
password: guest
...
...
```
## Contributing
**Feel free to contribute it or fork me...** :wink: