Send confirmation when changing emails

I have allowed my users to change their email address (set as their identity in Backendless). I would like to send them an email verification identical to the one they currently receive when signing up to my app. How can I achieve this?

All answers I have found about this topic seem to be pretty old and outdated, hence me asking again. Thanks!

Hello @Juan_Giraldo

you can create email confirmation Resend/Create Email Confirmation - Backendless REST API Documentation, then the status will be changed to pending. In response there are will be confirmation link you can send it to your clients.

Or you can call createEmailConfirmationURL then call resendconfirmation and you will receive email

Hello @sergey.kuk ,

We are trying to change a user status to “email confirmation pending” when user changes their email. Your answer implies that just Re-sending email confirmation should do the trick… but this doesn’t seem to be the case when using the codeless user API block. Can you tell me how we can set a users status to “email confirmation pending” when they change their email? Thnx

hello @Alex_Klein

Codeless has no block to create email confirmation, but you can call it via network.
Just execute POST request to https://api.backendless.com/<your-app-id>/<CLOUD-CODE-api-key>/users/createEmailConfirmationURL/ in after update event hendler

Then when you call update via API(won’t work if you change via DATA BROWSER) status will be changed

The response from createEmailConfirmationURL route will be like the following:

{"confirmationURL":"https://api.backendless.com/23298D6F-EA2F-7BE6-FFBF-7507875E1E00/12F8D46E-E26B-43B6-B642-218F110E2C7A/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBJZCI6IjIzMjk4RDZGLUVBMkYtN0JFNi1GRkJGLTc1MDc4NzVFMUUwMCIsImV4cCI6MTY4NTAwMjIzMSwidXNlcklkIjoiMDBEODg2RUEtRTk5My00M0NELUFFRjYtMTA0QjAwNTkyOUIwIn0.xlKHu_yAqEko18dIIre7vXNeq2Xtv4w2s0t5-rykU0k/users/confirmation"}

Thanks for the recipe, will try :grinning:

Hello @Alex_Klein @Juan_Giraldo

We added a Codeless block to generate the confirmation url.

Regards,
Inna

1 Like