InfoHeap
Tech
Navigation
  • Home
  • Tutorials
    • CSS tutorials & examples
    • CSS properties
    • Javascript cookbook
    • Linux/Unix Command Line
    • Mac
    • PHP
      • PHP functions online
      • PHP regex
    • WordPress
  • Online Tools
    • Text utilities
    • Online Lint Tools
search

Mailchimp

  • How to setup MailChimp email list
  • Mailchimp lightweight subscription form code
 
  • Home
  • > Mailchimp

Mailchimp lightweight subscription form code

By admin | Last updated on Mar 21, 2016

If you are using mailchimp for managing your newsletter campaigns, then you can either use a link to mailchimp site or use subscription form directly on you website. In both cases users are taken to mailchimp’s site, but in case of subscription form user enters the email address on your website. This reduces the barrier to subscribing to the newsletter.

Mailchimp default form

In case you are using subscription form option, here is how the default form code looks like:

<!-- Begin MailChimp Signup Form -->
<link href="http://cdn-images.mailchimp.com/embedcode/slim-081711.css" rel="stylesheet" type="text/css">
<style type="text/css">
        #mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }
        /* Add your own MailChimp form style overrides in your site stylesheet or in this style block.
           We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
</style>
<div id="mc_embed_signup">
<form action="/path/to/form/submit/url/" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
        <label for="mce-EMAIL">Subscribe to our mailing list</label>
        <input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="email address" required>
        <div class="clear"><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button"></div>
</form>
</div>
<!--End mc_embed_signup-->
try it online

Here is how it looks when implemented.
mailchimp-subscription-form-defaultThis code also uses an external css file http://cdn-images.mailchimp.com/embedcode/slim-081711.css. The file is not too big. But still it causes one extra round trip to MaillChimp CDN site.

Mailchimp lightweight form

Since user only needs to enter email on your website, a simple subscription form should be enough for your site. The form can just an html form, other fields and some inline css. You can avoid an external css file. Here is the form code which I tried.

<div id="mc_embed_signup">
<form action="/path/to/post/url/" method="post" target="_blank" >
        <label style="display:block;" for="mce-EMAIL">Subscribe to our mailing list</label>
        <input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="email address" required>
        <div><input style="background: #666; color: white; padding: 3px 10px; border-color: #666; border-radius: 4px;" type="submit" value="Subscribe" name="subscribe"></div>
</form>
</div>
try it online

Here is how it looks when implemented.
mailchimp-subscription-form-lightweightYou can use this code as a starting point and change its html and css according to your needs.

Suggested posts:

  1. how to use netcat (nc) to test HTTP url redirection
  2. Google feedburner email subscription vs Mailchimp
  3. How to setup Google feedburner email subscription newsletter
  4. How to setup MailChimp email list
  5. jQuery encode string to html entities
  6. CSS – align text in center horizontally
  7. Vim mini cheat sheet – handy commands reference
  8. HTML input checkbox
Share this article: share on facebook share on linkedin tweet this submit to reddit
Posted in Tutorials | Tagged CSS, Email marketing, Mailchimp, Tutorials, Web Development
  • Browse content
  • Article Topics
  • Article archives
  • Contact Us
Popular Topics: Android Development | AngularJS | Apache | AWS and EC2 | Bash shell scripting | Chrome developer tools | Company results | CSS | CSS cookbook | CSS properties | CSS Pseudo Classes | CSS selectors | CSS3 | CSS3 flexbox | Devops | Git | HTML | HTML5 | Java | Javascript | Javascript cookbook | Javascript DOM | jQuery | Kubernetes | Linux | Linux/Unix Command Line | Mac | Mac Command Line | Mysql | Networking | Node.js | Online Tools | PHP | PHP cookbook | PHP Regex | Python | Python array | Python cookbook | SEO | Site Performance | SSH | Ubuntu Linux | Web Development | Webmaster | Wordpress | Wordpress customization | Wordpress How To | Wordpress Mysql Queries | InfoHeap Money

Copyright © 2025 InfoHeap.

Powered by WordPress