Top WooCommerce & WordPress Plugins › Forums › Email Verification for WooCommerce › User getting “customer new account” email even if disabled
- Support forum for the Email Verification for WooCommerce.
- This topic has 6 replies, 4 voices, and was last updated 8 months, 3 weeks ago by
Pablo.
- AuthorPosts
- November 24, 2022 at 9:57 am #102722
Andrea
ParticipantHi, I want to completely disable the “Customer new account” email sent by WooCommerce since I have a custom one sent by Mailchimp. I set the mail disabled in “WooCommerce > Emails”, but it keeps being sent. It seems that your plugin is the culprit. I tried various permutations of the plugin settings but none does what I need. The relevant current settings in “Email Verification > Email” are as follows:
– Delay customer new account email enabled
– Send verification email as a separate mail enabled
– On “user register”
What can I do?Thanks
November 24, 2022 at 12:42 pm #102741Hello Andrea,
I am really sorry to know you are experiencing problems.
I couldn’t reproduce the issue on our end. Could you please ensure that in WooCommerce > Settings > Emails > New account, the Enable this email notification option is unchecked?
Kind regards,
MoshtafizurNovember 29, 2022 at 3:54 pm #103069Andrea
ParticipantI can confirm the option is unchecked. What can I do?
November 30, 2022 at 10:23 am #103112Hello,
Thanks for letting us know.
Would it be possible for you to share your WordPress dashboard access so that we can check it for you? Then please send us your login credentials to [email protected].
Kind regards,
MoshtafizurJanuary 3, 2023 at 4:11 pm #107010Andrea Baron
ParticipantHi Moshtafizur,
I found the problem. It comes from a change introduced in version 2.4.3 of the plugin.
In file includes/class-alg-wc-ev-emails.php on line 410 the function maybe_disable_customer_new_account_email does this:
function maybe_disable_customer_new_account_email( $enable ) {
$enable = $this->activate_customer_new_account_email;
return $enable;
}
and completely ignores what comes from the $enable argument. So if the email is disabled from WooCommerce, and your plugin wants it enabled (it happens through the enable_customer_new_account_email function when the woocommerce_created_customer_notification hook is called) the new_account email becomes enabled anyway.The function should be written like this:
function maybe_disable_customer_new_account_email( $enable ) {
return $enable && $this->activate_customer_new_account_email;
}
now, if the user wants the email enabled ($enabled is true) and also the plugin ($this->activate_customer_new_account_email is true) then the mail gets sent but not in the other cases, so the user preference is now honoured.I hope you can release an update soon.
Thanks!
January 3, 2023 at 4:21 pm #107013Hello Andrea,
Thanks for your reply.
I have escalated this with our development team. They will get back to you as soon as they can.
Kind regards,
MoshtafizurJanuary 4, 2023 at 8:16 pm #107068Thanks Andrea,
I have updated the code as you suggested with some minor changes and it seems to be working just fine.
Please, update the plugin to version 2.5.0 I just released and let me know if it helps 😉
- AuthorPosts
- You must be logged in to reply to this topic.