after reading a lot in the docs im still not sure: Are verification emails automatically created? I’m using a connection with a custom database and I’m not getting any verfication emails although verification emails are activated under “Emails → Templates” and I have a working smtp connection set up. Password reset emails do work.
I found this Customize Email Handling article, which has an example code for creating a verification email manually. But i can’t really believe that this is neccessary because
The password reset email works out of the box, no custom code needed. So why would the verification email be different?
It seems like a big hassle to manually get access tokens and and then manually call the management api via post request (like it’s external code/software, but actually it’s inside an auth0 rule) to simply create a verification email, which is actually a default functionality of auth0.
So I’m totally confused right now, whether I need to create them manually by calling the management api from a rule or if they should work out of the box.
Welcome to the Community! If you have enabled and configured the verification email, there should be no need to customize the template to get it to work. It has a default template. Are the verification emails going to spam? You can also try searching your logs for fv, fvr, sv, svr event types:
{“message”:“Mail has not been verified (activation link)”,“fromSandbox”:true}
The logs show
Type: Failed Signup
Description: Mail has not been verified (activation link)
(but the user is created in the database!)
The message Mail has not been verified (activation link) is my error message from the login script.
To me it looks like some internal process is trying to instantly login the user after sign up, which of course fails, and then no activation mail is sent because the whole sign up process failed with an error.
When testing my sign up script of the database connection, it works. There is no verification check in this script. The error message mentioned above only exists in the login script.
How do I prevent the login script from being automatically executed on sign up?
FYI, if someone is having the same problem: Still could not find a way to prevent the custom database login script being executed on signup. But I managed to solve my problem by moving the “is email verified?” check from the login script to a rule. This way the signup API call gets through and the verification mail is being send.
@Marius thanks for providing your update. To clarify, custom database connections will always run the login script after the create script - this is to verify that the user has successfully been created in the database and login attempts will work. Error responses during this process will cause the error to be throw from the /dbconnections/signup endpoint.
In short, both the login script and create script must successfully return the user profile from the custom database.