-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from DanielAraldi/feat/update-readme
docs: create readme and requirements to the project
- Loading branch information
Showing
4 changed files
with
83 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,63 @@ | ||
# Mailer 📫 | ||
|
||
<div style="width: 100%; display: flex; gap: 10px"> | ||
<div style="width: 100%; display: flex; flex-direction: row; flex-wrap: nowrap; justify-content: center; align-items: center; gap: 8px"> | ||
|
||
[![wakatime](https://wakatime.com/badge/user/920a7e43-2969-4212-82ff-1b375685ff58/project/00e95626-aa7e-4501-a6fd-3f315bc40b35.svg)](https://wakatime.com/badge/user/920a7e43-2969-4212-82ff-1b375685ff58/project/00e95626-aa7e-4501-a6fd-3f315bc40b35) | ||
|
||
[![Coverage Status](https://coveralls.io/repos/github/DanielAraldi/mailer/badge.svg?branch=feat/send-mail-controller)](https://coveralls.io/github/DanielAraldi/mailer?branch=feat/send-mail-controller) | ||
|
||
<a href="https://www.npmjs.com/package/git-commit-msg-linter"> | ||
<img src="https://badgen.net/badge/git-commit-msg-linter/3.0.0/yellow" alt="commit msg linted by git-commit-msg-linter" /> | ||
</a> | ||
|
||
</div> | ||
|
||
> Mailer is a micro-saas used to send emails 📩 | ||
<p align="center"> | ||
<img alt="GitHub top language" src="https://img.shields.io/github/languages/top/DanielAraldi/Mailer?style=flat-square"> | ||
<img alt="GitHub language count" src="https://img.shields.io/github/languages/count/DanielAraldi/Mailer?style=flat-square"> | ||
<img alt="GitHub" src="https://img.shields.io/github/license/DanielAraldi/Mailer?style=flat-square"> | ||
</p> | ||
|
||
<p align="center"> | ||
<a href="#📖-about">About</a> | | ||
<a href="#📫-api">API</a> | | ||
<a href="#🛠️-how-to-execute">How to Execute?</a> | | ||
<a href="#🏷️-license">License</a> | ||
</p> | ||
|
||
## 📖 About | ||
|
||
The Mailer is a service used only to send e-mail messages to people, it's focused to the business. We recommend that you use your app passwords that it's available from Google. You can create an app password [clicked here](https://myaccount.google.com/apppasswords). | ||
|
||
## 📫 API | ||
|
||
There are Mailer's endpoint. All endpoint starts with slug `/api`. | ||
|
||
[`/send`](./requirements/send.md) - Endpoint to send e-mail message. | ||
|
||
## 🛠️ How to Execute? | ||
|
||
- ### **Prerequisite** | ||
|
||
- It's **necessary** to possess the **[Git](https://git-scm.com/)** and **[Docker](https://www.docker.com/products/docker-desktop/)** installed and configured in your computer. | ||
- Also, it's **need** to have a package manager as **[Yarn](https://yarnpkg.com/)**, **[NPM](https://www.npmjs.com/)**, etc. | ||
- Finally, it's **necessary** to have **[Node.js](https://nodejs.org/en)** greater or equal version 16.13.x. | ||
|
||
1. Make a clone of repository: | ||
|
||
```sh | ||
$ git clone https://github.com/DanielAraldi/mailer.git | ||
``` | ||
|
||
## Introductions 📖 | ||
2. Added environment variables: | ||
|
||
- [Commands 🖖](#commands-🖖) | ||
Create a new file on root path called `.env`. Using the `.env.example` file as model and added the variables that exist it for your `.env` file. | ||
|
||
## Commands 🖖 | ||
3. Executing the application: | ||
|
||
- Create the project's `dist` folder: `npm run build` | ||
- Monitors and updates the `dist` folder: `npm run build:watch` | ||
- Run the project: `npm run start` | ||
```sh | ||
$ npm i # or yarn install to install all dependencies. | ||
$ npm run build # or yarn build to create dist folder with `.js` files that will be used in production. | ||
$ npm run up # or yarn up to run database in the docker. To stop the database run the `npm run stop` command. | ||
$ npm run start # or yarn start to run application. | ||
``` | ||
|
||
## License | ||
## 🏷️ License | ||
|
||
We use the [MIT license](./LICENSE). | ||
This e-mail service went development by [Daniel Sansão Araldi](https://github.com/DanielAraldi) and [Rafael Mota Alves](https://github.com/RafaelMotaAlvess). We use the [MIT license](./LICENSE). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Send e-mail | ||
|
||
Send e-mail endpoint is found on the `/api/send` path via `POST` HTTP method. | ||
|
||
## Parameters | ||
|
||
This endpoint is used to send e-mail, it accepts the following parameters: | ||
|
||
| field | type | description | required | | ||
| ---------- | ---------- | -------------------------------------------------------------------------------------- | -------- | | ||
| `from` | `string` | The e-mail address of the sender. | ✅ | | ||
| `to` | `string[]` | An `array` of recipients e-mail addresses that will appear on the **To** field. | ✅ | | ||
| `title` | `string` | The title of the e-mail. | ✅ | | ||
| `message` | `string` | E-mail message. | ✅ | | ||
| `login` | `string` | Your e-mail login to you be authentication in the Google e-mail service. | ✅ | | ||
| `password` | `string` | Your app password available by Google to be authenticate in the Google e-mail service. | ✅ | | ||
| `username` | `string` | Your username or alias. | ❌ | | ||
|
||
> To know more about the apps password, [click here](https://myaccount.google.com/apppasswords). | ||
The API will go to return **no content** when your e-mail went to sended with success. | ||
|
||
## Errors | ||
|
||
1. If some of the required properties doesn't sent for API request, an error HTTP 400 will be returned. | ||
2. An internal server error occurs in API during request, the API will return HTTP 500 error. | ||
3. If email doesn't sended with success, the API will return HTTP 400 error with an message that occurred a failed. | ||
|
||
The API error object will contain the follow properties: | ||
|
||
| field | type | description | required | | ||
| ------- | -------- | ------------------------------------ | -------- | | ||
| `error` | `string` | The error message returned from API. | ✅ | |