Wwwision.Neos.MailChimp icon indicating copy to clipboard operation
Wwwision.Neos.MailChimp copied to clipboard

WIP: Allow subscribe interest groups

Open dlubitz opened this issue 4 years ago • 3 comments

Mailchimp API has changed and likes to get "Interest Groups" instead of "Groupings".

Fixes: #14

dlubitz avatar Oct 26 '21 10:10 dlubitz

..little addition. I guess that the finisher should also be extended by options for marketingPermissions and interestGroups, right?

bwaidelich avatar Oct 26 '21 12:10 bwaidelich

You are right, the finisher needs also a change. Not sure how to implement it there properly. There are two scenarios:

  1. The developer configures the interest groups within the finisher definition. (Fix set of interest groups for a form)
  2. 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?

dlubitz avatar Oct 26 '21 13:10 dlubitz

The finisher options support placeholders, so

# ...
ids: "{fieldName}"

or

# ...
ids: ["abcde" "{fieldName}"]

might already work out of the box

bwaidelich avatar Nov 18 '21 22:11 bwaidelich

@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)

dlubitz avatar Mar 06 '23 15:03 dlubitz