fix(nrh): fixes for ESP contact syncing when Reader Revenue platform is NRH #3779
+31
−9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
All Submissions:
Changes proposed in this Pull Request:
It's possible to enable Reader Activation contact syncing while also using NRH instead of WooCommerce as a reader revenue platform, but this is currently broken.
Along with Automattic/newspack-newsletters#1763, handles ESP contact syncing when using NRH as a reader revenue platform, and/or WooCommerce Subscriptions is not available. WooCommerce itself is still a soft requirement for ESP syncing when using NRH, as we rely on its
WC_Customer
class for fetching basic user meta fields.This is an alternative to #1648 and brings back contact data filtering as proposed in #3415. I don't think we can get around using this filter, because certain reader registration and newsletters signup flows bypass the ESP sync classes (e.g. Newsletter Subscription Form block, Registration block).
Closes
1200550061930446/1209469667970736
.How to test the changes in this Pull Request:
release
, as a reader, sign up for newsletters via the Newsletter Subscription Form and Reader Registration blocks on a page that contains UTM parameters in the URL (e.g.?utm_medium=test&utm_campaign=NRH&utm_content=NRH%20content
. Observe that the contact sync to the connected ESP is logged, but without most of the RAS contact metadata fields. Also observe a fatal error in PHP:Fatal error: Uncaught Error: Call to undefined function wcs_get_users_subscriptions()
Other information: