This project is a simple Node.js Express application that allows users to sign up for a newsletter using the
Users can submit their first name, last name, and email address through a form, and the data is sent to a Mailchimp audience list for subscription.
- Node.js: A JavaScript runtime environment that executes JavaScript code outside of a web browser.
- Express.js: A minimalist web framework for Node.js used to build the web application and handle HTTP requests.
- Mailchimp API: An API provided by Mailchimp for managing email marketing campaigns, used to add subscribers to an audience list.
- HTML/CSS: Frontend languages used for creating the signup form and styling the web pages.
- Bootstrap: A CSS framework used for quickly styling the frontend components and improving responsiveness.
- Allows users to sign up for a newsletter by submitting their information.
- Validates user input on the server side to ensure data integrity.
- Sends subscription requests to the Mailchimp API for adding users to the audience list.
- Handles success and failure responses from the Mailchimp API.
- Provides error handling and redirects for a smooth user experience.
Before running the application, make sure you have the following:
- Node.js installed on your machine.
- Mailchimp account with API access and an audience list set up.
- Fill out the signup form with your first name, last name, and email address.
- Click the submit button to sign up for the newsletter.
- You will be redirected to a success or failure page based on the result of the subscription request.
-
Clone this repository to your local machine:
git clone <this project url>
-
Navigate to the project directory:
cd Nodejs-Express-Mailchimp-API-Newsletter-Signup
-
Install dependencies:
npm install
-
Set up environment variables:
Create a
.env
file in the project root and add your Mailchimp API key and audience list ID:MAILCHIMP_API_KEY=your_mailchimp_api_key MAILCHIMP_LIST_ID=your_mailchimp_audience_list_id
-
Run the application:
npm start
-
Access the application in your web browser at
http://localhost:3000
.
Contributions are welcome! Feel free to open issues or submit pull requests to improve the application.
This project is licensed under the MIT License.
Copyright Β© Shani Bider, 2024