This Node.js application provides user management functionalities, including creating user lists with custom fields, uploading CSV files to store users, sending emails to users in the list, and allowing users to unsubscribe from the list.
- Create user lists with custom fields.
- Upload CSV files to add users to the list.
- Send bulk emails to users in the list.
- Users can unsubscribe from the list via email links.
To run this application locally, follow these steps:
- Node.js (v12 or higher)
- MongoDB
-
Clone the repository and install dependencies:
git clone https://github.com/AnkitNayan83/User_Management.git cd User_Management npm install
-
Create a .env file in the root directory of the project with the following variables:
DB_URL=<Your MongoDB connection URL> EMAIL=<Your admin email for sending emails> SENDGRID_API_KEY=<Your SendGrid API key>
Start the Node.js server:
npm start
POST /api/lists/ : Create a new list.
POST /api/lists/:id/user : Upload a CSV file to add users.
POST /api/lists/:id/send-email : Send emails to users in the list.
GET /api/user/unsubscribe/:id : To unsubscribe from emails.
GET /api/user/subscribe/:id : To subscribe to emails.