JAndrew13 / NewsletterSignup

A web landing page for users to join a newsletter mailing list. This project uses Google Authentication and a Mailchimp API to successfully store user data.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Newsletter Signup Page stable

Between your IG posts, blue check tweets, and lengthy Facebook rants, it's nearly impossible for your devoted followers to keep up with your every waking breath and shower thought. That is why I created this easy to use web signup, because let's face it - everyone needs a personal mailing list.

Built using Bootstrap along-side basic html and css - this app is simple yet effective. The user is greeted by a standard bootstrap form, allowing them to enter their contact info. When the user submits their data, the express app then uses BodyParser to extract the data in key:value pairs and then packs that into JSON. The JSON data is then stringified for the API, and finally posted to the MailChimp Server. Once a response from the API server is recived, the user is redirected to either a success or failure page depending on the result.

Table of contents

Prerequisites

  • any HTML code editor of your choice, such as Visual Studio, Atom, Pycharm, etc.
  • install Node.js
  • Setup a MailChimp account

Installation

  1. clone the repository to your desired location.
  2. Install the required packages in the terminal $ npm install

Setup Your Mailchimp API

  1. Follow the steps provided in the MailChimp API Documentation to obtain an API key and setup a new audience. This step gives the web forms a place to send and store your followers information.

  2. Create an .env file in the root project folder.

  3. Inside the .env file, add in your endpoint and key to the first two lines as seen below, using your code editor.

     `MAILCHIMP_API_ENDPOINT= "YourApiEndpoint"`
     `MAILCHIMP_API_KEY= "YourApiKey"`
    
  4. Save the .env file

Start the Server

  1. In a new terminal window, navigate to the project folder
  2. Start the app from your terminal $ node app.js
  3. In you browser's address bar, navigate to http://http://localhost:3000/

(back to top)

How It Works

Behind the Scenes, this project is pretty simple. We've got 3 html pages, an app.js logic file, and an .env containing keys. Ill give a little breakdown below of what each of these files do, and how they interact.

app.js

The app.js file acts as the root starting point for the app, as well as the logic behind the pages interactions. At the top of the file (lines 1-17) are all of the setup commands for the server, package setups, and declarations. Below this are the app's get, post, and API request functions. These functions tell the app what actions were preformed by the user, as well as what to do next.

signup.html

This is the main view of the website upon load-up. This page contains all of the Bootstrap forms the user interacts with, as well as some In-line CSS styling.

success.html

This page is where the user gets sent once they completed the signup process after their information is successfully sent to the MailChimp API.

failure.html

This is the fallback page the user is sent to if an error occurred in their provided data, or within the API request process.

.env file

The .env file will contain your sensitive information, thus it is not included in this repositories starting files. Upon cloning the repository, you'll need to create your own .env file and enter in your personal API key and endpoint. (explained above).

(back to top)

Directory

CSS Folder containing CSS style sheet linked to the HTML document

images Contains all image files used in the web page.

Contains all html pages, .env file, and JS logic.

(back to top)

Contact

Jake Brunner - jbbrunner10@gmail.com

LinkedIn - https://www.linkedin.com/in/jake-brunner-21760522b/

This Repository - https://github.com/jandrew13/Web-Dev-Bootcamp

(back to top)

Acknowledgments

(back to top)

About

A web landing page for users to join a newsletter mailing list. This project uses Google Authentication and a Mailchimp API to successfully store user data.


Languages

Language:HTML 65.5%Language:JavaScript 24.1%Language:CSS 6.6%Language:Dockerfile 3.5%Language:Procfile 0.2%