NodeJs APIs to perform Email Scheduling.
Features :
- Schedule an Email.
- Reschedule an Email.
- Get details of scheduled emails.
- Delete a scheduled email.
- Source email supports only gmail addressess(enable less secure app access in your gmail account)
- node >= v12.x
- npm >= 6.x
npm install
Rename .env.example as .env and populate with respective values.
npm start
- 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}}"
}'
- 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}}"
}'
- Get all pending and scheduled emails
curl --location --request GET 'http://localhost:6000/email/v1/get-status'
- Delete a scheduled email
curl --location --request POST 'http://localhost:6000/email/v1/delete' \
--header 'Content-Type: application/json' \
--data-raw '{
"id" :"5ff194b9fb6298247c161931"
}'