fix(mailchimp): remove cache and improve logs when preparing merge fields #1644
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:
We should always fetch the most recent merge fields when deciding whether a new merge field should be created, which is not possible behind a cache layer. We're currently having issues with duplicate fields being created due to outdated data coming from cache.
This PR removes the cache layer when fetching merge fields on
prepare_merge_fields()
and improves logs to benefit from the new logging strategy via thenewspack_log
action hook.The base is
alpha
so we can get this out for the next release.How to test the changes in this Pull Request:
NP_Account
), and create new random merge fields until it reaches the limit of 30reader_logged_in
is dispatched:NP_Account
NP_Account
merge fieldsreader_logged_in
dispatch, that the merge field is created and populated with the user IDOther information: