swordfox / silverstripe-userform-mailchimpfield
Adds a custom field to UserForms which allows you to select a list from MailChimp and subscribe on submission.
Installs: 473
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:silverstripe-vendormodule
README
#MailChimp UserForm Field Adds a custom field to UserForms which allows you to select a list from MailChimp and subscribe on submission.
Also allows additional merge_fields to be added for each field in the form.
Installation
Via composer
composer require swordfox/silverstripe-userform-mailchimpfield
Configuration
To connect to your MailChimp field you will need to set two fields in your config.yml.
Swordfox\UserForms\EditableMailChimpField:
api_key: 'API KEY GOES HERE'
^ These setting can be found in client settings area in MailChimp.
Customisation
You can also change what type of field is actually used on the UserForm. By Default it's a checkbox field. You can change this via your config.yml OR via the CMS per form.
Extensions
There are a few extension hooks which can be useful to handle data before and after saving throughout the process.
$this->extend('beforeValueFromData', $data)
$this->extend('afterValueFromData', $data)
$this->extend('updateLists', $data)