This project implements a subscription newsletter component using Next.js, TypeScript, and Mailchimp. It provides a user-friendly form for newsletter sign-ups, with real-time validation and seamless integration with the Mailchimp API.
Setup a Newsletter with Next.js, TypeScript and Mailchimp
- Next.js
- TypeScript
- Mailchimp
- Axios
- Zod
- Subscription form with real-time validation
- Integration with Mailchimp API for newsletter subscription
- created a Rest API endpoint for form submission to save the user email.
- Reflect state of component and gives users the function, e.g, loading state, error state and success state results.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- clone repository
https://github.com/Kellswork/newsletter-mailchimp.git
- navigate to the folder location
- cd into the folder
- in your terminal, run
npm install
to install dependencies - set up necessary environment variables (details in the Configuration section).
- run
npm run dev
to start the project in the development environment
To configure the project, you'll need to set the following environment variables:
- MAILCHIMP_API_KEY
- MAILCHIMP_API_SERVER
- MAILCHIMP_AUDIENCE_ID
- Mailchimp API
- Kelechi Ogbonna
For issues or support, please open an issue or contact me at [kells@agirlcodes.dev].