Skip to content
Flow package that integrates MailChimp into your Neos / Flow installation
PHP HTML
Branch: master
Clone or download
bwaidelich Merge pull request #23 from kdambekalns/task/tweak-readme
Update README.md to refer to "audience", not "list"
Latest commit 98d4d24 Dec 11, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Classes/Wwwision/Neos/MailChimp Merge pull request #24 from kdambekalns/bugfix/member-list-shows-pending Dec 11, 2019
Configuration Remove remaining "formBuilder" setting May 9, 2018
Resources/Private/Templates/Module/MailChimp Remove note about good-bye email Nov 26, 2019
LICENSE * Initial commit Dec 25, 2014
Module_Lists.png * Screenshots of TYPO3 Neos module Dec 25, 2014
Module_Members.png * Screenshots of TYPO3 Neos module Dec 25, 2014
README.md
composer.json TASK: Mark migrations as applied Sep 19, 2019

README.md

Wwwision.Neos.MailChimp

Package that integrates MailChimp® to your Neos site or Flow application.

Features

This package comes with two main features:

  1. A MailChimp® subscription finisher for the Flow Form Framework
  2. A simple Neos module that allows Neos administrators to manage MailChimp® lists and recipients

Usage

Install this package and make sure to resolve all dependencies. The easiest way to install this package is to use composer by adding

"wwwision/neos-mailchimp": "^5.2"

to your Site package (or whichever package that uses the module or service) and install it and its dependencies via composer install.

After successful installation make sure to configure the MailChimp® API key in the Settings.yamlof your Site package:

Wwwision:
  Neos:
    MailChimp:
      apiKey: '<VALID_MAILCHIMP_API_KEY>'

Note: The API key can be obtained from mailchimp.com > Account > Extras > API keys

Done. You can now log-in to the Neos backend (as administrator) and manage your newsletter lists and recipients in the new Module administration/mailchimp (Make sure to flush the browser caches if the module should not appear in the menu).

Neos Module

The module is pretty simple and self-explanatory. Currently it allows for:

  1. Displaying all lists
  2. Displaying details of single lists including creation date, sender information, number of recipients
  3. Displaying all members of a selected list
  4. Removing members from a list
  5. Subscribing new members to a list

Screenshot of the lists module Screenshot of the members

Form Finisher

This package also comes with a simple form finisher that allows for creation of simple Newsletter subscription forms using the Flow Form Framework.

Alternatively you can save the following snippet to Data/Forms/newsletter.yaml to create a simple newsletter subscription form:

type: 'Neos.Form:Form'
identifier: mailchimp
label: Mailchimp
renderables:
    -
        type: 'Neos.Form:Page'
        identifier: page1
        label: 'Page 1'
        renderables:
            -
                type: 'Neos.Form:SingleLineText'
                identifier: 'firstName'
                label: 'First name'
                validators:
                    -
                        identifier: 'Neos.Flow:NotEmpty'
                properties:
                    placeholder: 'Your first name'
                defaultValue: ''
            -
                type: 'Neos.Form:SingleLineText'
                identifier: 'lastName'
                label: 'Last name'
                validators:
                    -
                        identifier: 'Neos.Flow:NotEmpty'
                properties:
                    placeholder: 'Your last name'
                defaultValue: ''
            -
                type: 'Neos.Form:SingleLineText'
                identifier: 'email'
                label: 'E-Mail'
                validators:
                    -
                        identifier: 'Neos.Flow:NotEmpty'
                    -
                        identifier: 'Neos.Flow:EmailAddress'
                    -
                        identifier: 'Wwwision.Neos.MailChimp:UniqueSubscription'
                        options:
                          listId: '<MAILCHIMP-LIST-ID>'
                properties:
                    placeholder: 'Your email address'
                defaultValue: ''
finishers:
    -
        identifier: 'Wwwision.Neos.MailChimp:MailChimpSubscriptionFinisher'
        options:
            listId: '<MAILCHIMP-AUDIENCE-ID>'
            additionalFields:
              'FNAME': '{firstName}'
              'LNAME': '{lastName}'
    -
        identifier: 'Neos.Form:Confirmation'
        options:
            message: 'Thank you, your subscription was successful. Please check your email.'
renderingOptions:
    submitButtonLabel: ''

Note: Replace the two "<MAILCHIMP-AUDIENCE-ID>" with a valid audience (list) identifier that can be obtained from mailchimp.com > Audience > <YOUR-AUDIENCE> > Settings > Audience name & defaults. An Audience ID usually contains numbers such as "1243568790".

The additionalFields option can be nested, for example in order to specify interest groups:

# ...
finishers:
    -
        identifier: 'Wwwision.Neos.MailChimp:MailChimpSubscriptionFinisher'
        options:
            listId: '<MAILCHIMP-AUDIENCE-ID>'
            additionalFields:
              'FNAME': '{firstName}'
              'LNAME': '{lastName}'
              'groupings':
                  -
                      id: '12345'
                      groups: ['Some group', 'Some other group']

The Form finisher can of course be used without Neos (i.e. for Newsletter-subscriptions within plain Flow applications).

Trivia

This package demonstrates...

...how to reuse Neos layouts and partials with Views.yaml

...how to create & configure a form finishers so that it can be used in the Form definition

...how to make use of Objects.yaml to initialize custom API clients

...how to make arbitrary result sets countable and "paginatable" using a CallbackQueryResult object

FAQ

  • I get an error No MailChimp lists found. Did you configure the API key correctly at Wwwision.Neos.MailChimp.apiKey?, what's wrong with me?
    • Make sure you have configured the API key in the Settings and in the form finisher configuration as described above. If that's the case, make sure your Package dependency is correct. That means: The package that configures the API key must require the wwwision/neos-mailchimp package in the composer.json manifest. Otherwise the loading order is incorrect and the API key might be overridden by the default settings

License

Licensed under GPLv3+, see LICENSE

You can’t perform that action at this time.