This was my third task on my internship @Asterisc Technocrat
I used these technologies :
Email automation is a way to create emails that reach the right people with the right message at the right moment without doing the work every time, sending automated emails leveraging a marketing automation tool.
the term of emails will be mentioned as event ( we can say that any scheduled email is a scheduled event , etc.. )
{
email : { type : String , required : true } ,
bussinesName : { type : String , required : true } ,
userName : { type : String , required : true } ,
password : { type : String , required : true } ,
whyToUse : { type : String , required : true } , // why to use our automated mails service ( student , bussines owner , hr , other , etc.....)
userTemplates : [ {
emailSubject : { type : String , required : true } ,
emailContent : { type : String , required : true } ,
createdAt : { type : Date , required : true } ,
templateName : { type : String , required : true } ,
} ] ,
isVerified : { type : Boolean , default : false }
}
Endpoint
Method
Usage
/signUp
POST
allows user to create an account
/login
POST
allows user to sign in and login to his account
/forgetPassword
POST
allows user to ask for a new password
/sendEmail
POST
allows user to make immediate event and send email to a group of users
/editProfile
PATCH
allows user to edit/update his profile
/changePassword
PATCH
allows user to change his password
/verifyAccount
GET
allows customer to recive a verify his email after creating account
{
userMail : { type : String , required : true } ,
userName : { type : String , required : true } ,
userId : { type : mongoose . Types . ObjectId , required : true } ,
templateName : { type : String , required : true } ,
eventName : { type : String , required : true } ,
eventStatus : { type : String , default : "pending" } , // done , pending
recivers : [ {
email : { type : String , required : true } ,
} ] ,
createdAt : { type : Date , required : true } ,
sendAt : { type : Date , required : true } ,
isScheduled : { type : Boolean , default : false } ,
}
Endpoint
Method
Usage
/getAllScheduledEvents
GET
allows user to get all his scheduled events
/addEvent
POST
allows user to create and schedule event ( schedule emails )
/cancelScheduledEvent/:jobId
DELETE
allows user to cancel any scheduled event
template schema will be found as an array of obj and it's part of user schema :
userTemplates : [ {
emailSubject : { type : String , required : true } ,
emailContent : { type : String , required : true } ,
createdAt : { type : Date , required : true } ,
templateName : { type : String , required : true } ,
} ] ,
Endpoint
Method
Usage
/getAllTemplates
GET
allows user to get all his templates
/addTemplate
PATCH
allows user to add/create a new template
/editSpecificTemplate/:templateId
PATCH
allows user to edit template
/deleteTemplate/:templateId
PUT
allows user to delete template
all the services is full production using onrender
cloud services
you can run the project using the following command : npm start
all get requests has a pagination you can send page ( default = 1 ) and limit default = 10 ) in the URL