Start a new topic
Answered

emailVerify doesn't work

Hello everyone!!

I'm developping an App on NodeJS, I tried to add email verification option to my App but it shows the error "user.emailVerify is not a function".
Here is the code :

mail_verification:function(){
      var userData = JSON.parse($window.localStorage.getItem('newUser'));
      //var activeUser = $kinvey.User.getActiveUser();
      var user = new $kinvey.User(userData);
      user.verifyEmail().then(function(response) {
            
              }).catch(function(error) {

              });
    },



Best Answer
Braiek,

Glad it is working for you. Thanks for the update.

Thanks,
Pranav


 


Hi,


Are you able to see the user being signed in Kinvey Console after signup completes? You should be calling verifyEmail function after sign up completes successfully. That would need a code change as below:

 

signup: function (data) {
	var user = $kinvey.User.signup({
		// user data goes here
	});
	promise.then(function(user) {
		...
	      // email verification call goes here
		return user;
	}).catch(function(error) {
		...
	});
    }

 


Also, any specific reason for not using Kinvey-initiated email verification workflow (You can set up email verification emails to be sent automatically in Kinvey console - http://devcenter.kinvey.com/angular/guides/users#emailverification)?



Regards,

Wani
Kinvey Support

Hello, In fact that was the first thing i did to perform email verification by activating it via the console but i didn't receive the emil verification neither. Regards

Hello Braiek,


Understood. Thanks for the quick reply. We'll get back with regarding this shortly.


What version of the Node.js SDK are you using? Our latest version is 3.5.0.


Regards,


Billy Gee

Hello Braiek,


I think I just discovered that you are using Node.js SDK v3.5.0, correct? We will continue our investigating using this assumpetion.


Regards,


Billy

Yes I am using node.js sdk v3.5.0 Thank you for the support

Hello Braiek,


I don't see that you replied to Pranav's request to check your spam folder. Can you please let us know about that?


Is your latest response referring to Wani's suggestion about a code change in the first paragraph of his last update or his last question regarding email verification workflow?


Can you please send Pranav (pranav@kinvey.com) and copy me (billy@kinvey.com) an email that contains the user name, email and _id from the Users collection for the user you are trying to send this verification email to? I want to check our outbound email service and see if the verification email actually made it to our service and ultimately the user's email inbox or not.


We look forward to hearing back from you.


Regards,


Billy Gee




Hello, 
Sorry my response is late, It was 3 days holidays in France.
I tried that and it didn't work for me. 
Regards,

Hello Braiek,


I am sharing a couple of things for you to try.


You are using `$kinvey` in a couple of places but since this is a Node.js app you should be using 'Kinvey'.


The second thing is that `verifyEmail()` is a static method so you should use `Kinvey.User.verifyEmail('<username>')` instead.


Please give those suggestions a try and see if this resolves your problem.


Regards,


Billy Gee

Hello Braiek,


When you say it didn't work for you, what results or errors did you see to help identify what might be wrong?


Regards,


Billy Gee

Good Morning,
It shows no error but I don't receive the verification mail in the adresse mail when signing up,
regards,

It's working now Thank you for fixing the issue 

Answer
Braiek,

Glad it is working for you. Thanks for the update.

Thanks,
Pranav


 

Hello Braiek,


In the code you are using the correct function, "user.verifyEmail" but in your problem description you say that, "user.emailVerify" is not a function.


Can you check confirm which function you are actually using in the code when you are seeing the error?


Regards,


Billy Gee

Braiek,


Does the "email" field in user's collection has user's email id filled in it? If you save "email id" as username, you won't receive the verification mail. "Email" column in user collection must contain email id information for sending emails to users for any reason. When you enable 'Email Verification', "Email" field is mandatory while signup.


Also, just to confirm, please check spam folder.

 

Thanks,

Pranav

Kinvey

Login or Signup to post a comment