A
A
Alexander2016-04-14 22:03:06
WordPress
Alexander, 2016-04-14 22:03:06

Why is add_action not working in wordpress plugin?

I'm trying to write a plugin so that the new customer of the Wocomer will receive an email notification
with his details and a discount coupon
, I can't get it to send a letter, the
letter generally sends normally
to another hook, I hang up, the letters reach
, but I don't understand how to make a new user receive a letter during registration why is
the plugin code not working

function new_customer_registered_send_email_admin($user_login) {
    $to = '[email protected]';  //EMAIL получателя
    $subject = 'тема письма'; //Тема письма
    $message = 'прошло'.$user_login; 
    wp_mail($to, $subject, $message);
}
add_action('new_customer_registered', 'new_customer_registered_send_email_admin');

in file /wp-content/themes/Avada/woocommerce/emails/customer-new-account.php
added
<?php do_action( 'new_customer_registered', $user_login ); ?>

without a plugin. registration letters also do not reach
others. at the same time, they normally arrive (new order, forgot the password, etc.)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question