-
Notifications
You must be signed in to change notification settings - Fork 27
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
[APM2-59] fix underline issue related to disable merchant new order email for on-hold #232
Conversation
…plicate processing status email to be send
…make decision to send processing status order email
just checking if you've tested other payment methods to see they still work as expected 🙂 |
@kan98 |
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 ); | ||
} | ||
} |
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.
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.
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.
Let's me see
… to static mailer class
Try to add unit test for Helper function but too complicated !! |
No problem! Thanks for refactoring the function out 🙂 . PR looks good to me 👍🏽 |
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