0

so, I’m using JSON API, and I'm registering user with

localhost/api/user/register/?username=name&user_pass=pass123&email=example@example.com&nonce=0c308f17af&display_name=name&notify=yes

When I do that I want to user get activation email, and he’s not getting any, he’s getting info about a new account created. How can I accomplish that user first gets an activation email with link to activate its acc?

is this somehow possible?

  • What JSON API are you using? – Emil Dec 6 '16 at 14:45
  • I'm assuming this: wordpress.org/plugins/json-api-user - either way, WordPress standard behavior for user registration is not to send a verification email, so you'll probably need to code a function for this. There's a post about this here: wordpress.stackexchange.com/questions/117522/… – Emil Dec 6 '16 at 14:56
  • Yes. I use that API. – Josip Ivic Dec 6 '16 at 14:58
  • How do you know that the user did not receive email? – Tung Du Dec 7 '16 at 9:39
  • You really asked me this question? :D – Josip Ivic Dec 7 '16 at 9:43
1

Set your query var notify to user (if you want to send an email to the user only) or both (if you want to send it to the user and the admin).

Within the plugin controller/User.php:165 calls wp_new_user_notification with $_REQUEST['notify'].

wp_new_user_notification is (lucky you) a pluggable function. If you have your activation logic ready to use, you can overwrite this function and send a modified email to the user. You can overwrite it within a custom mu-plugin (must use plugin).

  • Create (if not exists) a mu-plugins folder within wp-content
  • Create a pluggable.php file. All files within mu-plugins behave like plugins, but are auto-loaded.
  • Create your version of wp_new_user_notification

If you don't have an activation logic in hand, you can use the answer in the question @Emil described in his comment.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.