# Verification Email automatically created for custom database connections?

**URL:** <https://community.auth0.com/t/verification-email-automatically-created-for-custom-database-connections/23478>\
**Category:** Get Help\
**Tags:** verification-email\
**Created:** [April 3, 2019, 7:45am UTC](https://community.auth0.com/t/verification-email-automatically-created-for-custom-database-connections/23478 "2019-04-03T07:45:58Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marius](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marius/32/12206_2.png) [@Marius](https://community.auth0.com/u/Marius)\
**Post date:** [April 3, 2019, 7:45am UTC](https://community.auth0.com/t/verification-email-automatically-created-for-custom-database-connections/23478/1 "2019-04-03T07:45:59Z")

</div>

Hi there,

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 and Ticket Handling with the Management API - Auth0 Docs](https://auth0.com/docs/email/custom) article, which has an example code for creating a verification email **manually**. But i can’t really believe that this is neccessary because

1. The password reset email works out of the box, no custom code needed. So why would the verification email be different?
2. 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.

Thanks!

---

<div class="post-metadata">

**Author:** ![markd](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/markd/32/38919_2.png) [@markd](https://community.auth0.com/u/markd)\
**Post date:** [April 3, 2019, 12:12pm UTC](https://community.auth0.com/t/verification-email-automatically-created-for-custom-database-connections/23478/2 "2019-04-03T12:12:01Z")

</div>

Hello @Marius,

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:

```auto
type:fv* or type:sv*

```

---

<div class="post-metadata">

**Author:** ![Marius](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marius/32/12206_2.png) [@Marius](https://community.auth0.com/u/Marius)\
**Post date:** [April 3, 2019, 12:43pm UTC](https://community.auth0.com/t/verification-email-automatically-created-for-custom-database-connections/23478/3 "2019-04-03T12:43:37Z")

</div>

Thanks for your quick response! No Mails in Spam, no logs with

> type:fv\* or type:sv\*

But now I think I’m coming closer to the problem. When signing up, I get a HTTP 500 response from  
[https://tagxter.eu.auth0.com/dbconnections/signup](https://tagxter.eu.auth0.com/dbconnections/signup)

> {“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?

---

<div class="post-metadata">

**Author:** ![prashantT](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/prashantt/32/6002_2.png) [@prashantT](https://community.auth0.com/u/prashantT)\
**Post date:** [April 5, 2019, 1:52am UTC](https://community.auth0.com/t/verification-email-automatically-created-for-custom-database-connections/23478/4 "2019-04-05T01:52:11Z")

</div>

@Marius if you are testing the signup using Lock, by default it will attempt to log the user in after sign up. The Lock `loginAfterSignUp` configuration attribute that can be set to `false` to prevent this:  
[https://auth0.com/docs/libraries/lock/v11/configuration#loginaftersignup-boolean-](https://auth0.com/docs/libraries/lock/v11/configuration#loginaftersignup-boolean-)

---

<div class="post-metadata">

**Author:** ![Marius](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marius/32/12206_2.png) [@Marius](https://community.auth0.com/u/Marius)\
**Post date:** [April 5, 2019, 6:16am UTC](https://community.auth0.com/t/verification-email-automatically-created-for-custom-database-connections/23478/5 "2019-04-05T06:16:47Z")

</div>

I’m using the reuglar web app login like described in [Auth0 PHP SDK Quickstarts: Login](https://auth0.com/docs/quickstart/webapp/php)

when i press “sign up” it creates the **signup** call to  
_[https://tagxter.eu.auth0.com/dbconnections/signup](https://tagxter.eu.auth0.com/dbconnections/signup)_ with the 500 error, returning my error message from the **login** script. The ui shows

> WE’RE SORRY, SOMETHING WENT WRONG WHEN ATTEMPTING TO SIGN UP.

(user is created in the database, but no mail is sent)  
Is there any similar setting for the default web login?

---

<div class="post-metadata">

**Author:** ![Marius](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marius/32/12206_2.png) [@Marius](https://community.auth0.com/u/Marius)\
**Post date:** [April 8, 2019, 6:16am UTC](https://community.auth0.com/t/verification-email-automatically-created-for-custom-database-connections/23478/6 "2019-04-08T06:16:27Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![prashantT](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/prashantt/32/6002_2.png) [@prashantT](https://community.auth0.com/u/prashantT)\
**Post date:** [April 11, 2019, 2:59am UTC](https://community.auth0.com/t/verification-email-automatically-created-for-custom-database-connections/23478/7 "2019-04-11T02:59:37Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [April 26, 2019, 2:59am UTC](https://community.auth0.com/t/verification-email-automatically-created-for-custom-database-connections/23478/8 "2019-04-26T02:59:40Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
