This microservice provides functionality to send emails, manage subscriptions, and handle email verification.
-
Clone the repository:
git clone https://github.com/your-username/mail-server-microservice.git
-
Navigate to the project directory:
cd mail-server-microservice
-
Install dependencies:
npm install
- Create a .env file in the project root and add the following environment variables:
SENDGRID_API_KEY=your-sendgrid-api-key [email protected] MONGODB_URL=your-mongodb-connection-url PORT=3000
- Update other configurations in the source code as needed.
POST /api/send-email : Send an email to a recipient.
POST /api/subscribe : Subscribe an email for updates.
POST /api/unsubscribe : Unsubscribe an email.
POST /api/verify-code : Verify an email verification code.
POST /api/send-verification-code : Send a verification code to an email.
-
Start the server:
npm start
-
Make API requests to the specified endpoints using tools like curl or Postman.
-
Refer to the API Endpoints section for detailed information about each endpoint.
Contributions are welcome! Here's how you can contribute to this project:
- Fork the repository.
- Create a new branch: git checkout -b feature/your-feature-name.
- Make your changes and commit them: git commit -m "Add new feature".
- Push to the branch: git push origin feature/your-feature-name.
- Create a pull request describing your changes.