最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin4浏览0评论

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.

发布评论

评论列表(0)

  1. 暂无评论