Skip to content

kriston97/sendEmail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sendEmail

NodeJs APIs to perform Email Scheduling.

Features :

  1. Schedule an Email.
  2. Reschedule an Email.
  3. Get details of scheduled emails.
  4. Delete a scheduled email.

Note

  1. Source email supports only gmail addressess(enable less secure app access in your gmail account)

Requirements

  1. node >= v12.x
  2. npm >= 6.x

Setup

Step-1:

npm install

Step-2:

Rename .env.example as .env and populate with respective values.

Step-3:

npm start

Available Endpoints

  1. Schedule an Email
curl --location --request GET 'http://localhost:6000/email/v1/schedule' \
--header 'Content-Type: application/json' \
--data-raw '{
    "recipient" : "{{email_address}}",
    "subject" : "{{subject}}",
    "emailBody" : "{{body}}",
    "scheduledDate" : "{{YYYY-MM-DD}}",
    "scheduledTime" : "{{HH:MM}}"
}'
  1. ReSchedule an Email
curl --location --request POST 'http://localhost:6000/email/v1/reschedule' \
--header 'Content-Type: application/json' \
--data-raw '{
    "id" : "{{_object_id_from_mongodb}}",
    "scheduledDate" : "{{YYYY-MM-DD}}",
    "scheduledTime" : "{{HH:MM}}"
}'
  1. Get all pending and scheduled emails
curl --location --request GET 'http://localhost:6000/email/v1/get-status'
  1. Delete a scheduled email
curl --location --request POST 'http://localhost:6000/email/v1/delete' \
--header 'Content-Type: application/json' \
--data-raw '{
    "id" :"5ff194b9fb6298247c161931"
}'

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published