[APM2-59] fix underline issue related to disable merchant new order email for on-hold#232
Merged
nimitomise merged 10 commits intomasterfrom Oct 20, 2021
Merged
[APM2-59] fix underline issue related to disable merchant new order email for on-hold#232nimitomise merged 10 commits intomasterfrom
nimitomise merged 10 commits intomasterfrom
Conversation
kan98
approved these changes
Oct 18, 2021
hpariwat
approved these changes
Oct 18, 2021
added 5 commits
October 19, 2021 13:02
…plicate processing status email to be send
…make decision to send processing status order email
Contributor
|
just checking if you've tested other payment methods to see they still work as expected 🙂 |
Contributor
Author
|
@kan98 |
kan98
reviewed
Oct 19, 2021
Comment on lines
+94
to
+99
| public function email_processing_admin_notification( $order_id, $order ) { | ||
| $payment_gateway = wc_get_payment_gateway_by_order( $order ); | ||
| if (is_a( $payment_gateway, 'Omise_Payment' ) && $payment_gateway->enabled_processing_notification) { | ||
| WC()->mailer()->get_emails()['WC_Email_New_Order']->trigger( $order_id ); | ||
| } | ||
| } |
Contributor
There was a problem hiding this comment.
not sure if it's worth refactoring this into a helper or service class. Benefit is we can move this logic out of the payment class and we can write some unit tests and mock a few orders to see they work as expected.
hpariwat
approved these changes
Oct 19, 2021
… to static mailer class
tookaa2
approved these changes
Oct 20, 2021
added 2 commits
October 20, 2021 17:09
Contributor
Author
|
Try to add unit test for Helper function but too complicated !! |
kan98
reviewed
Oct 20, 2021
Contributor
No problem! Thanks for refactoring the function out 🙂 . PR looks good to me 👍🏽 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Related information:
Related PR(s): #232
Override Woocommerce filter for woocommerce_email_recipient_new_order which able to initiate with status as on-hold to not send order email to merchant.
Override woocommerce_order_status_processing to send notification email depend on payment method
processing🔧 Environments:
Tested locally by pointing OMISE_API_URL to staging-omise
WooCommerce: v5.7.1
WordPress: v5.8
PHP version: 7.1
✏️ Details:
Make sure setting merchant email at /wp-admin/admin.php?page=wc-settings&tab=email§ion=wc_email_new_order or /wp-admin/admin.php?page=wc-settings&tab=email to your valid email
Checkout cart with Paynow payment make sure customer email is valid and accessible
Go to customer mail box should still receive new order email
Go to merchant mail box should not receive new order email
Checkout cart with Credit Card and accessible
Go to customer mail box should still receive new order email
Go to merchant mail box should still receive new order email
Impact of the change
No
Priority of change
Normal
Additional Notes
No