This repository will not be updated. The repository will be kept available in read-only mode.
Add subscriptions to MailChimp lists.
- install module
- fill in module settings
- MailChimp api key
- Mailchimp list ID for new subscribers
- Subscriber Status
- Use subscribed to add an address right away.
- Use pending to send a confirmation email.
- Select email field
- Select email field (choose from existing ones) which should be attached to the form.
- The field settings are used for ProcessWires way of form processing e.g. validation.
- Select firstname field
- Select firstname field (choose from existing ones) which should be attached to the form.
- Optional: leave this field blank to skip firstname.
- Select lastname field
- Select lastname field (choose from existing ones) which should be attached to the form.
- Optional: leave this field blank to skip lastname.
- call module
echo $modules->get('MailChimp')->render();
Have a look at your log files (ProcessWire Admin > Setup > Logs).
Hookable method called before the form is rendered.
Adds possibility to add custom fields.
Example:
$this->addHookAfter('MailChimp::addFields', $this, 'hookAddFields');
public function hookAddFields(HookEvent $event) {
$form = $event->arguments(0);
if (!$form->get('interests')) {
$select = $this->modules->get('InputfieldSelect');
$select->name = 'interests';
$select->addOption('A', $this->_('Option A'));
$select->addOption('B', $this->_('Option B'));
$form->append($select);
}
}
Hookable method called before the form is processed.
Adds possibility to modify data before subscribing.
Find the full list of fields available in the List Member Schema.
Example:
$this->addHookAfter('MailChimp::modifyData', $this, 'hookModifyData');
public function hookModifyData(HookEvent $event) {
$data = $event->arguments(0);
$data['interests'] = ['2s3a384h' => true];
$event->return = $data;
}