dev-master
9999999-devSilverStripe 3 MailChimp Integration
The Requires
by IQnection
pages iqnection
SilverStripe 3 MailChimp Integration
Provides functionality to add contacts to Mailchimp Directly integrates with IQnection's Base Pages module, (*1)
Log in to MailChimp as the client: https://login.mailchimp.com, (*2)
Create a Mailchimp API key. At the time this was written, this was located under Account > Extras > API Keys., (*3)
If using the IQnection BasePages module, a field will automatically be added to the form controls tab in the CMS to select which list submissions should be added to., (*4)
Create an extension for your page, and add the following function to the Controller Extension:, (*5)
class FormSubmission extends DataObject { public function onBeforeWrite() { parent::onBeforeWrite(); if (!$this->ID) { $mc = new Mailchimp(SiteConfig::current_site_config()->MailchimpApiKey); $result = $mc->addContact($this->Email, 'my_mailchimp_list_id', $this->FirstName, $this->LastName); } return $this; } }, (*6)
SilverStripe 3 MailChimp Integration
pages iqnection