WIP: Allow subscribe interest groups
Mailchimp API has changed and likes to get "Interest Groups" instead of "Groupings".
Fixes: #14
..little addition. I guess that the finisher should also be extended by options for marketingPermissions and interestGroups, right?
You are right, the finisher needs also a change. Not sure how to implement it there properly. There are two scenarios:
- The developer configures the interest groups within the finisher definition. (Fix set of interest groups for a form)
- There is a set of interest groups, which can be selected by each user within the form.
Maybe like this:
finishers:
-
identifier: 'Wwwision.Neos.MailChimp:MailChimpSubscriptionFinisher'
options:
listId: '<MAILCHIMP-AUDIENCE-ID>'
additionalFields:
'FNAME': '{firstName}'
'LNAME': '{lastName}'
interestGroups:
ids: ["abcde","defghi"] # Scenario 1
fieldName: "interestGroups" # Scenario 2 (Name of the form field, which conains the IDs as array
Could also be combined. WDYT?
The finisher options support placeholders, so
# ...
ids: "{fieldName}"
or
# ...
ids: ["abcde" "{fieldName}"]
might already work out of the box
@bwaidelich Actually this doesn't work, as the field value might be an array. So it can't replace the string placeholder.
Bit hacky, but could work:
ids: ["{fieldName.0}", "{fieldName.1}", "{fieldName.2}"]
(In case you provide multiple checkboxes with different interest groups)