admin管理员组

文章数量:1321425

I was wondering if I could make it so that if I approve a user account via "Users" UI that an automatic email is sent to the user saying something like "Hey, your account on www.website has been approved, thanks for your patience!"

Is this possible in WordPress core, or is this something that has to be added manually?

Thanks in advance.

I was wondering if I could make it so that if I approve a user account via "Users" UI that an automatic email is sent to the user saying something like "Hey, your account on www.website has been approved, thanks for your patience!"

Is this possible in WordPress core, or is this something that has to be added manually?

Thanks in advance.

Share Improve this question edited Feb 14, 2019 at 12:30 butlerblog 5,1013 gold badges26 silver badges43 bronze badges asked Feb 14, 2019 at 12:00 Arne De BelserArne De Belser 358 bronze badges 3
  • WordPress core doesn't even have a method for 'approving' users at all, so the answer would depend entirely on how you'd implemented that functionality. Are you using a plugin? – Jacob Peattie Commented Feb 14, 2019 at 12:19
  • Hello there, I just found out that WP Forms (plugin) adds this functionality, so I'll probably have to contact them. – Arne De Belser Commented Feb 14, 2019 at 12:31
  • I found that WP Forms add a field wpforms-pending to the wp_user_meta table, so this is probably the field I'm looking for. This issue is not solved as it not a WordPress core issue. Thanks for your help. – Arne De Belser Commented Feb 14, 2019 at 12:42
Add a comment  | 

1 Answer 1

Reset to default 0

What you are trying to do - approve a user in the admin and send an email - must be done using action and filter hooks, either by a plugin you're using or your own code in your child theme or a plugin.

To approve a user, take a look at the user_register, edit_user_profile, edit_user_profile_update and load-user-edit.php hooks to get started. In your own approval code, you would then structure your email and send it with the wp_mail() function.

Try searching the net for detailed solutions, you should be able to find blog posts with ready code.

本文标签: How do I make WordPress send an email to the user when his account gets approved (manual by me)