Parse.com resend confirmation email

I use the email verification feature that Parse offers and would like my users to be able to resend the confirmation email if it is not sent or they cannot see it. The last thing I saw, Parse did not offer a fundamental way to do this (silly), and people were half-perverted in writing code to change the email address and then change it to cause a re-sending. Have there been any updates to this or changing emails from the original and back is still the only way? Thanks

+4
source share
2 answers

You only need to update the letter to its existing value. This should trigger the sending of another email. I could not verify the code, but it should be the way you do it for different platforms.

// Swift
PFUser.currentUser().email = PFUser.currentUser().email
PFUser.currentUser().saveInBackground()

// Java
ParseUser.getCurrentUser().setEmail(ParseUser.getCurrentUser().getEmail());
ParseUser.getCurrentUser().saveInBackground();

// JavaScript
Parse.User.current().set("email", Parse.User.current().get("email"));
Parse.User.current().save();
+3
source

You must set the email address for fake saving and then set it back to the original and then parse the verification process. Just setting it to what it was will not trigger the process.

iOS

           if let email = PFUser.currentUser()?.email {
                PFUser.currentUser()?.email = email+".verify"
                PFUser.currentUser()?.saveInBackgroundWithBlock({ (success, error) -> Void in
                    if success {
                        PFUser.currentUser()?.email = email
                        PFUser.currentUser()?.saveEventually()
                    }
                })
            }
+1
source

All Articles