MailChimPHP - Customizable Subscription Form

Created: 01 October 2011
By: Alexis Serneels
Email: alexis@opla.be

I want to thank you for buying this script. It was prepared with love in order to simplify drastically your implementation. This documentation will give you all the details you may need. Please contact me for any question.


Table of Contents

  1. Goal
  2. Requirements
  3. Files and Structure
  4. Installation
  5. Configuration
  6. Credits

Goal - top

This script will allow you to insert a custom form on any webpage of your website and let people subscribe themselves to your MailChimp Newsletter list.


Requirements - top

In order to run this script on your website, you'll need :


Files and Structure - top

I've organized this script as follow :


Installation - top

To use this script on your server, follow those steps :

  1. Edit the conf/config.mailchimp.php file according to the configuration section below.
  2. Upload these folders and files to your server :
    • classes/
    • conf/
    • MC.php
    Warning : These files will have to be on the same level (aka : folder) as the page in which you will put the form code (aka : the code below).

If you want to use the default CSS style provided in this package for your form :

  1. Edit the css/style.css file
  2. Upload this folder to your server :
    • css/

If you want to use your CSS style for the form :

  1. Edit your CSS file by adding the following selectors :
    • label
    • input[name="email"]
    • input[name="name"]
    • input[name="surname"]
    • form p

It is now time to insert the form inside your webpage.
You have three options, choose the one you prefer :

Option 1 - Complex Form

This code displays three form fields : Email, Name, Surname. All those will be registered in your MailChimp List.
Note : The Name and surname fields are still optional.
Note : The email field is not optional.

Copy and paste the code below in your own webpage where you want it to appear.

<!-- MailChimp Form START -->
<form action="MC.php" method="post" accept-charset="utf-8">
  <p><label for="name">Your name</label><input type="text" name="name" value="" id="name"></p>
  <p><label for="surname">Your surname</label><input type="text" name="surname" value="" id="surname"></p>
  <p><label for="email">Your email</label><input type="text" name="email" value="" id="email"></p>
  <p><input type="submit" id="submit" name="submit" value="Subscribe"></p>
</form>
<!-- MailChimp Form END -->
		

Tip : You are welcome to edit any HTML tags as you wish. Just be sure to keep intact the ID and NAME tags of the form elements.
If your MC.php file is not located on the same folder than this code, please enter the correct path by changing this part of the code:

				form action="THE_CORRECT_PATH/MC.php" method="post"
			

Option 2 - Simple Form

This code displays only one form field : Email
Note : The email field is not optional.

Copy and paste the code below in your own webpage where you want it to appear.

<!-- MailChimp Form START -->
<form action="MC.php" method="post" accept-charset="utf-8">
  <p><label for="email">Your email</label><input type="text" name="email" value="" id="email"></p>
  <p><input type="submit" id="submit" name="submit" value="Subscribe"></p>
</form>
<!-- MailChimp Form END -->

Tip : You are welcome to edit any HTML tags as you wish. Just be sure to keep intact the ID and NAME tags of the form elements.
If your MC.php file is not located on the same folder than this code, please enter the correct path by changing this part of the code:

				form action="THE_CORRECT_PATH/MC.php" method="post"
			

Option 3 - Your own Form

You can even use your own form to use with this script. To do so, please check to use the following NAMES and ID'S for your form inputs.

And now, you're ready !


Configuration - top

To configure the script, please edit the conf/config.mailchimp.php file.
Each configuration line has an hint above it in order for you to choose the right option. Here are they in details :


Credits - top

This script uses the MailChimp PHP API Wrapper 1.3 which is released under the MIT license.


Once again, thank you so much for purchasing this script. I'd be glad to help you if you have any questions.

Alexis Serneels

Go To Table of Contents