-
xenophyle β
committed feb4a9b4 on 2.x
Issue #3253483 by mattjones86: Add hook to alter interest groups in the...
-
xenophyle β
committed feb4a9b4 on 2.x
Currently, it's possible to use an alter hook to update the $mergevars
with additional data, but it's not currently possible to do the same with the Interest groups.
I'm updating a site that was developed prior to Interest Group support being added. It instead used a taxonomy to set extra $mergevars
checkboxes, and these were then used to create Segments in Mailchimp.
Unfortunately our client has deleted and re-created their list, and Mailchimp no longer seems to support creating new MergeVars checkboxes, in favour of using Interest Groups instead.
This has left me in an awkward situation where I have data in their Drupal taxonomy fields which is disconnected from Mailchimp, with no easy way to copy it over.
Add a new mailchimp_lists_interest_groups
hook to allow interest groups to be populated from other form field data.
Added mailchimp_lists_interest_groups
hook.
/**
* Alter interest groups before they are sent to Mailchimp.
*
* @param array $interests
* The current interest groups.
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity used to populate the interest groups.
* @param string $choices
* The entity form submission data.
*
* @ingroup mailchimp
*/
function hook_mailchimp_lists_interest_groups_alter(array &$interests, EntityInterface $entity, array $choices) {
}
Fixed
2.0
Lists Module
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Issue #3253483 by mattjones86: Add hook to alter interest groups in the...