Adds mailchimp integration to SilverStripe, eventually inside a widget
PHP Scheme
Switch branches/tags
Clone or download
Pull request Compare This branch is 6 commits ahead of g4b0:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


MailChimp subscription form

Customizable mailchimp subscribtion form. Simply put the form into your template, and eventually customize it through a .ss template file. It could also be injected into a widget, or used inside a page through the MailChimpExtension extension.

Maintainer Contact

Sam Sehnert []


  • Customizable form template
  • Subscription widget form
  • Static function callable from outside

Warning! Version 2.0 is not compatible with 1.* configuration. Page extension now is MailChimpExtension (no more MailChip)


  • Silverstripe framework ~3.1
  • Silverstripe cms ~3.1


  • silverstripe/widget
  • zirak/widget-pages-extension


Install it through composer:

	composer require customd/silverstripe-mailchimp

Using the form

From everywhere in your template you can render your form

<div id="mailchimp-form">

You can eventually also override the default template, just add a in themes/mytheme/template/Includes:

<form $FormAttributes>

			<div class="input-append newsLatterBox text-center">
				<% if $Fields.dataFieldByName(Email).Message %><span class="message $Fields.dataFieldByName(Email).MessageType">$Fields.dataFieldByName(Email).Message</span><% end_if %>
				$Fields.dataFieldByName(Email).addExtraClass(full).addExtraClass(text-center).setAttribute(placeholder, Email)
				<button class="btn  bg-gray" type="submit"> Registrati <i class="fa fa-long-arrow-right"> </i> </button>


Using in a page

Extend the Page class (or whatever class you want to use) whit the MailChimp extension:

Name: mailchimp-extensions
    - MailChimpExtension

Then render the $MailChimpSubscribeForm variable inside your template:

<% include SideBar %>
<div class="content-container unit size3of4 lastUnit">
		<div class="content">$Content</div>

Using inside a widget

Simply use the MailChimpSubscribe widget as usual documentation here

Using inside a widget with widget-pages-extension

Define the widgetareas in your pages, like stated in widget-pages-extension module After that define which widget are allowed for your pages, in particular MailChimpSubscribe.

For example your Page.php will become

class Page extends SiteTree {

	private static $db = array(
	private static $has_one = array(
			'SideBar' => 'WidgetArea'
	private static $allowed_widgets = array(


Run a /dev/build?flush=all and enjoy your widgets. Due to a known issue in widget-pages-extension you have to save each page you will need to put the widgets on. For more information about how to use the widgets please see the widget-pages-extension module documentations


  • Configure your MailChimp APIKEY and ListID
  • Enable the widget
  • Play with the mailchimp.yml config file in your mysite folder, in conjunction with the MailChimp configurations. Follow a sample mailchimp.yml
Name: mailchimp
  #apikey - see
  apikey: API-KEY
  # A List Id to run examples against. use lists() to view all
  # Also, login to MC account, go to List, then List Tools, and look for the List ID entry
  listid: LIST-ID
  redirect: true
  redirect_ok: 'reg-ok/'
  redirect_ko: 'reg-ko/'
  country: true
  topics: true
  topicsArr: ['Web development', 'Sysadmin', 'PHP', 'Javascript', 'HTML & CSS']
  otherTopic: true