-
Notifications
You must be signed in to change notification settings - Fork 92
Added GPNF Delay Child Notifications to the library #85
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
Conversation
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.
Overall LGTM, just need to sync up one of the comments from moving it into the class 🙂
gp-nested-forms/gp-nested-forms-delay-child-notifications-for-parent-payment.php
Outdated
Show resolved
Hide resolved
Solution looks good! I'm assuming the customer must be using multiple payment gateways; some that support delayed payments and some that do not. If the user isn't using a payment gateway with delayed payments this wouldn't be necessary. If that's correct, could you add a comment to explain some of the logic here? Only other thing is restructing the code a bit. We have a Snippet Template now that will keep a consistent experience for our customers and for us as we maintain these. |
Haha, after I explained how all this worked to Clay, I realized that it might be simpler to actually remove the function bound to the
|
@spivurno That did the trick. I've also formatted the snippet to match the template and tested on the user's site. |
gp-nested-forms/gp-nested-forms-delay-child-notifications-for-parent-payment.php
Show resolved
Hide resolved
gp-nested-forms/gp-nested-forms-delay-child-notifications-for-parent-payment.php
Outdated
Show resolved
Hide resolved
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.
-
It doesn't look like the
form_ids
arg is being used anymore. -
Can we update this so each instance only applies to a single form? Rather than providing
form_ids
the user would provide a singleform_id
and create an instance of the class for each form.I know some of these details are a undocumented knowledge. Sorry about that. Writing our snippets per form gives more flexibility to control how it works for each form. Doesn't specifically apply here now but if we expand on this with more options in the future we'll be better poised for that granular control.
@spivurno Done. One thing to note, I had to restore the |
Code structure looks good! And rats! I was hoping we could avoid having to remove the default functionality. Since we're keeping this: remove_filter( 'gform_entry_post_save', array( gpnf_notification_processing(), 'maybe_send_child_notifications' ), 11 ); Let's add a comment explaining why. And remove this: // Prevent double notifications for non-delayed payment gateways.
remove_filter( 'gform_post_payment_completed', array( $this, 'gpnf_should_send_notification' ) ); It doesn't the work the way I was hoping it would. |
@spivurno Done! |
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.
Thanks for sticking it out, Eihab! Approved. ✅
This PR imports the GPNF Delay Child Notifications for Parent Payment snippet.
It also fixes an issue where notifications were sent twice by filtering on
gform_entry_post_save
and specific parent form IDs.#23899 / DWC.