Skip to content

rifqdev/mailer-services

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mailer-services

📝 Table of Contents

🧐 About

This Node.js API project is designed to smooth the email sending process in your application. By leveraging Nodemailer and Google SMTP, this API allows you to easily send emails automatically. You just need to send data like the recipient's email address, subject, and message body, and the API will handle the rest.

🏁 Getting Started

Prerequisites

Clone this project

git clone https://github.com/rifqdev/mailer-services.git

Rename .env.example to .env and Please configure your Google SMTP

GMAIL_APP_PASS=
GMAIL_USER=

Your services port by default is 3000

PORT=

You can add multiple uri frontend e.g [uri1, uri2]

FRONTEND_URL=[]

Mail destination is your email

MAIL_DESTINATION=

Installing

A step by step to running local environment

Install dependencies

npm install

Make sure the .env file is correct and then to run this server

npm run dev

🎈 Usage

To use it, if you are in a local environment, open Postman or another similar application:

http://localhost:3000/api/send-email/v1
Method POST
Request Body:

  email: emailsender@gmail.com
  message: message from sender

If success will return like this

{
    "success": true,
    "message": "email has sended",
    "data": null,
    "code": 200
}

🚀 Deployment

I have deployed this project to Vercel, that's why you will see the vercel.json file, if you want to also deploy to Vercel then you should be able to deploy directly and don't need to change the vercel.json file. And remember, don't forget to set the environment variables in Vercel

⛏️ Built Using

✍️ Authors

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors