Nicely integrate MailChimp lists with SilverStripe FlexiForms. Includes support for Interest Groups & more., (*1)
Requirements
SilverStripe FlexiForm https://github.com/briceburg/silverstripe-flexiform, (*2)
ZfrMailChimp https://github.com/zf-fr/zfr-mailchimp, (*3)
Tested in SilverStripe 3.1, (*4)
Screenshots
, (*5)
, (*6)
Installation
php composer.phar require briceburg/silverstripe-mailchimp-flexiform
Usage
This module integrates your SilverStripe flexiforms with MailChimp through the MailChimp v2 API., (*7)
You associate a form with a MailChimp List. When a valid submission is made, the
submitter is subscribed to the associated list and optionally
added to selected Interest Groups., (*8)
You have control over Welcome Emails, Double Opt-In, and Email Preferences., (*9)
Configuration is per-form, allowing you to override the default handler settings. E.g. You may use the same handler on forms which subscribe the user to different lists., (*10)
-
Install this module and trigger the environment builder (/dev/build)., (*11)
-
Create a new Mailchimp Handler
under the Manage Handlers area from any FlexiForm Settings tab., (*12)
-
Assign the Mailchimp Handler to any form you wish to integrate with MailChimp. Save. The MailChimp tab will appear where you may further configure the integration., (*13)
You may programatically create forms integrated with MailChimp using the
convenicences of flexiform., (*14)
# mysite/_config/config.yml
# Make sure we have an Email Field named `Email`
FlexiFormEmailField:
required_field_definitions:
- Name: Email
Readonly: true
# Make sure we have a MailChimp Handler named `NewsletterHandler`
FlexiFormMailChimpHandler:
required_handler_definitions:
- Name: NewsletterHandler
MailChimpListID: 0ffffff,
MailChimpApiKey: 0000000-us9,
Readonly: true
# Automatically create a Content Block with a MailChimp enabled flexiform
CommonContentNewsletterBlock:
required_records:
- Title: sidebar
Heading: iCEBURG Labs Newsletter
Content: iCEBURG Labs is proud to offer an email subscription service...
Readonly: true
flexiform_default_handler_name: NewsletterHandler
flexiform_initial_fields:
- Name: Email
Type: FlexiFormEmailField
Prompt: Email
Required: true
class CommonContentNewsletterBlock extends CommonContentBlock
{
private static $label = 'Newsletter Block';
private static $extensions = array(
'FlexiFormExtension'
);
...
}
To learn more, read the flexiform configuration documentation., (*15)
This example uses the commoncontent addon., (*16)