-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(data-events): mailchimp connector #2233
Conversation
Requesting a review from @adekbadek because it uses a lot of his code on a different backend strategy to produce a similar result. |
I've tested everything just from a functional point of view, following the instructions, and everything worked just fine. I also tested making a donation before registering and that did not sync (not sure it was expected to) |
It will bail if a contact (registered user) is not available, but if a reader is created during (after) the donation is made we might need to tweak it on the WC integration side so that it becomes available at the hook. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since @leogermani did functional testing, I've only looked at the code. The changes to class-woocommerce-connection.php
look fine. Left one note about argument order – after this is fixed we're good to merge.
This field (and a few others) are based on the assumption that a reader would buy a single product, which aligns with a membership-driven model. Newspack supports more models, but this specific integration was requested by a membership-focused third party. |
In the interest of feature parity, 89e9566 implements the It can be extended to also handle |
@leogermani I tried on both Stripe and Newspack platforms and an anonymous donation (fresh session) did sync without issues. Which platform were you using, can you provide more details? |
Sounds good! |
# [1.103.0-alpha.2](v1.103.0-alpha.1...v1.103.0-alpha.2) (2023-02-17) ### Bug Fixes * **ads-wizard:** cancelled state of unit displayed on the list ([#2272](#2272)) ([e10b592](e10b592)) * **ads:** remove fixed height setting ([#2255](#2255)) ([0031b89](0031b89)) * change default auth strategy to "link" ([#2261](#2261)) ([c4b2e2c](c4b2e2c)) * update package.json to resolve a merge conflict with master ([f2408a3](f2408a3)) * **webhooks:** check if endpoint exists ([#2276](#2276)) ([5a95e2c](5a95e2c)) ### Features * bootstrap GA4 connector ([#2241](#2241)) ([f7582a4](f7582a4)) * **data-events:** mailchimp connector ([#2233](#2233)) ([08060c6](08060c6)) * **data-events:** standardize the use of "user_id" and "email" ([#2263](#2263)) ([d6b6903](d6b6903)) * **donations:** add payment metadata and update renewal description ([#2254](#2254)) ([b039304](b039304)) * **my-account:** display stripe billing link regardless of RR platform ([df540fe](df540fe)) * **perfmatters:** defaults adjustments, remove feature flag ([#2271](#2271)) ([cf5ad51](cf5ad51)) * **performance:** minify all inline CSS ([#2239](#2239)) ([fbb415f](fbb415f)) * **ras:** enable custom contact metadata prefixes ([#2249](#2249)) ([e9843e4](e9843e4)) * require all woo plugins for RAS ([#2260](#2260)) ([5f6a818](5f6a818)) * **stripe:** create native WC Subscriptions (if feature flag is set) ([#2251](#2251)) ([009a8a5](009a8a5)) * **webhooks:** support label for endpoints ([#2262](#2262)) ([39da7be](39da7be))
🎉 This PR is included in version 1.103.0-alpha.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
# [1.104.0-alpha.1](v1.103.0...v1.104.0-alpha.1) (2023-02-17) ### Bug Fixes * **ads-wizard:** cancelled state of unit displayed on the list ([#2272](#2272)) ([e10b592](e10b592)) * **ads:** remove fixed height setting ([#2255](#2255)) ([0031b89](0031b89)) * change default auth strategy to "link" ([#2261](#2261)) ([c4b2e2c](c4b2e2c)) * **webhooks:** check if endpoint exists ([#2276](#2276)) ([5a95e2c](5a95e2c)) ### Features * bootstrap GA4 connector ([#2241](#2241)) ([f7582a4](f7582a4)) * **data-events:** mailchimp connector ([#2233](#2233)) ([08060c6](08060c6)) * **data-events:** standardize the use of "user_id" and "email" ([#2263](#2263)) ([d6b6903](d6b6903)) * **donations:** add payment metadata and update renewal description ([#2254](#2254)) ([b039304](b039304)) * **my-account:** display stripe billing link regardless of RR platform ([df540fe](df540fe)) * **perfmatters:** defaults adjustments, remove feature flag ([#2271](#2271)) ([cf5ad51](cf5ad51)) * **performance:** minify all inline CSS ([#2239](#2239)) ([fbb415f](fbb415f)) * **ras:** enable custom contact metadata prefixes ([#2249](#2249)) ([e9843e4](e9843e4)) * require all woo plugins for RAS ([#2260](#2260)) ([5f6a818](5f6a818)) * **stripe:** create native WC Subscriptions (if feature flag is set) ([#2251](#2251)) ([009a8a5](009a8a5)) * **webhooks:** support label for endpoints ([#2262](#2262)) ([39da7be](39da7be))
🎉 This PR is included in version 1.104.0-alpha.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
# [1.105.0-alpha.1](v1.104.0...v1.105.0-alpha.1) (2023-02-20) ### Bug Fixes * **ads-wizard:** cancelled state of unit displayed on the list ([#2272](#2272)) ([e10b592](e10b592)) * **ads:** remove fixed height setting ([#2255](#2255)) ([0031b89](0031b89)) * change default auth strategy to "link" ([#2261](#2261)) ([c4b2e2c](c4b2e2c)) * **webhooks:** check if endpoint exists ([#2276](#2276)) ([5a95e2c](5a95e2c)) ### Features * bootstrap GA4 connector ([#2241](#2241)) ([f7582a4](f7582a4)) * **data-events:** mailchimp connector ([#2233](#2233)) ([08060c6](08060c6)) * **data-events:** standardize the use of "user_id" and "email" ([#2263](#2263)) ([d6b6903](d6b6903)) * **donations:** add payment metadata and update renewal description ([#2254](#2254)) ([b039304](b039304)) * **my-account:** display stripe billing link regardless of RR platform ([df540fe](df540fe)) * **perfmatters:** defaults adjustments, remove feature flag ([#2271](#2271)) ([cf5ad51](cf5ad51)) * **performance:** minify all inline CSS ([#2239](#2239)) ([fbb415f](fbb415f)) * **ras:** enable custom contact metadata prefixes ([#2249](#2249)) ([e9843e4](e9843e4)) * require all woo plugins for RAS ([#2260](#2260)) ([5f6a818](5f6a818)) * **stripe:** create native WC Subscriptions (if feature flag is set) ([#2251](#2251)) ([009a8a5](009a8a5)) * **webhooks:** support label for endpoints ([#2262](#2262)) ([39da7be](39da7be))
🎉 This PR is included in version 1.105.0-alpha.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 1.105.0-hotfix-hpb-amp-optimisations.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
# [1.105.0](v1.104.1...v1.105.0) (2023-02-28) ### Bug Fixes * **ads-wizard:** cancelled state of unit displayed on the list ([#2272](#2272)) ([e10b592](e10b592)) * **ads:** remove fixed height setting ([#2255](#2255)) ([0031b89](0031b89)) * change default auth strategy to "link" ([#2261](#2261)) ([c4b2e2c](c4b2e2c)) * **webhooks:** check if endpoint exists ([#2276](#2276)) ([5a95e2c](5a95e2c)) ### Features * bootstrap GA4 connector ([#2241](#2241)) ([f7582a4](f7582a4)) * **data-events:** mailchimp connector ([#2233](#2233)) ([08060c6](08060c6)) * **data-events:** standardize the use of "user_id" and "email" ([#2263](#2263)) ([d6b6903](d6b6903)) * **donations:** add payment metadata and update renewal description ([#2254](#2254)) ([b039304](b039304)) * **my-account:** display stripe billing link regardless of RR platform ([df540fe](df540fe)) * **perfmatters:** defaults adjustments, remove feature flag ([#2271](#2271)) ([cf5ad51](cf5ad51)) * **performance:** minify all inline CSS ([#2239](#2239)) ([fbb415f](fbb415f)) * **ras:** enable custom contact metadata prefixes ([#2249](#2249)) ([e9843e4](e9843e4)) * require all woo plugins for RAS ([#2260](#2260)) ([5f6a818](5f6a818)) * **stripe:** create native WC Subscriptions (if feature flag is set) ([#2251](#2251)) ([009a8a5](009a8a5)) * **webhooks:** support label for endpoints ([#2262](#2262)) ([39da7be](39da7be))
🎉 This PR is included in version 1.105.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
All Submissions:
Changes proposed in this Pull Request:
Implements the Mailchimp connector using Data Events, producing a result similar to what is achieved for ActiveCampaign with RAS.
Just like the AC implementation, this also requires a "master list", or a single audience, to send the data to. It will automatically fetch from the "Mailchimp for WooCommerce" plugin setting if it's not configured in the RAS setting
mailchimp_audience_id
.The UI for configuring Mailchimp's master list should be built next, not in this PR.
The data transformation borrows the logic from
WooCommerce_Connection
, by moving the contact generation portion to aget_contact_from_order( $order )
method so it can be reused.The same logic used for ActiveCampaign in
Newspack\Newspack_Newsletters
is not reproduced, meaning:NP_Product Name
is removed. This value will change with every different purchase, it's not clear to me the purpose of treating it as a singular contact data. Perhaps we need a better strategy for this?The contact is upserted as soon as registered, with
status
set totransactional
if it's new (not yet subscribed), through a handler attached to thereader_registered
action.Purchase updates are sent through a handler at the
donation_new
action. The order data is transformed withWooCommerce_Connection::get_contact_from_order( $order );
.How to test the changes in this Pull Request:
Mailchimp for WooCommerce
plugin configure with the same account and set it to an audience (this is required only until we have our own UI for setting the master list)Executing action handlers for "reader_registered"
is loggedtransactional
and the following merge fields filled:NP_Account
NP_Registration Page
NP_Registration Method
get_contact_from_order()
is updated to the same contactOther information: