API Pull - Enable pull and push mechanism to work together #2428
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.
Changes proposed in this Pull Request:
Part of #2146
For the initial launch, we want to keep both the pull and push mechanisms working together. This PR enables sending the notification (pull mechanism) and the usual job to push the data.
Screenshots:
Detailed test instructions:
add_filter( 'woocommerce_gla_notifications_enabled', '__return_true' );
and run this commandwp option update gla_wpcom_rest_api_status "approved"
Create Product
gla/jobs/update_products/process_item
with the product that you createdgla/jobs/notifications/products/process_item
with the itemID = the product ID that you created and the topicproduct.create
Update Product
gla/jobs/update_products/process_item
with the product that you updatedgla/jobs/notifications/products/process_item
with the itemID = the product ID that you updated and the topicproduct.update
Delete Product
gla/jobs/delete_products/process_item
with the product that you deleted.gla/jobs/notifications/products/process_item
with the itemID = the product ID that you deleted and the topicproduct.delete
Create Coupon
gla/jobs/update_coupon/process_item
with the coupon that you createdgla/jobs/notifications/coupons/process_item
with the itemID = the coupon ID that you created and the topiccoupon.create
Update Coupon
gla/jobs/update_coupon/process_item
with the coupon that you updatedgla/jobs/notifications/coupons/process_item
with the itemID = the coupon ID that you updated and the topicproduct.update
Delete Coupon
gla/jobs/delete_coupon/process_item
with the coupon that you deleted.gla/jobs/notifications/coupons/process_item
with the itemID = the coupon ID that you deleted and the topiccoupon.delete
Update Shipping Settings
gla/jobs/notifications/shipping/process_item
with the topicshipping.update
Additional details:
Currently, for shipping notifications, we haven't included the topic in the body, only in the header. For consistency, I think it's better to include it in the body as well, so I added it here.: https://github.com/woocommerce/google-listings-and-ads/pull/2428/files#diff-f9aaeb6620028c10c8ce8c3178abf2f6db34168939ba33c4d8bcef410a5125b5R148
Changelog entry