FusionAuth
    • Home
    • Categories
    • Recent
    • Popular
    • Pricing
    • Contact us
    • Docs
    • Login

    /api/user/verify-email doesn't resend the verification email

    Scheduled Pinned Locked Moved
    Q&A
    0
    4
    1.7k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      maxim.kremenev
      last edited by

      I'm trying to use /api/user/verify-email to resend the activation email, but nothing happens.

      When I call this method, I got 200 response code and an empty body

      PUT https://example.com/api/user/verify-email?email=me%40example.com
      

      When setting the Authorization header, I got JSON with verificationId but again, no emails were sent.

      1 Reply Last reply Reply Quote 0
      • joshuaJ
        joshua
        last edited by joshua

        @maxim-kremenev,

        Happy Friday! The API that you have listed is only for simply marking users as "email-verified." (see here)

        Sending the verification email requires a separate API call (aka resend verification email) or would be fired when the user is registered to your application. Here are some places to check on tenant and application to ensure you can send verification emails when a user registers for your application.

        At the tenant level

        Ensure you have the SMTP server set up to ensure that emails can be sent.

        • https://fusionauth.io/docs/v1/tech/email-templates/configure-email/

        At the application level

        You will want to ensure:

        1. That you don't have skipVerification set to true when a user registers for an application via API.
          See this option under - https://fusionauth.io/docs/v1/tech/apis/registrations/
        2. Your application has verifyRegistration set to true. This can be set programmatically via the API or via the admin UI.
          See below

        Via API

        (https://fusionauth.io/docs/v1/tech/apis/applications/)
        v-fy-orginal.png

        Via Admin UI

        7baee0e9-7917-497a-9146-3d2a5754ddec-image.png

        I hope this helps!

        Thanks,
        Josh

        1 Reply Last reply Reply Quote 0
        • M
          maxim.kremenev
          last edited by

          Happy Friday! The API that you have listed is only for simply marking users as "email-verified." (see here)

          But according to documentation, it is about to resend the email

          2df4845a-94cd-4372-ac71-13e5ec61b23d-image.png

          New users receive emails about verification, but I want to make a button in my application to resend this email, and right now I see 200 responses with an empty body.

          1 Reply Last reply Reply Quote 0
          • joshuaJ
            joshua
            last edited by joshua

            @maxim-kremenev,

            Sorry to hear that you are still having problems.

            But according to documentation, it is about to resend the email

            I was a bit confused, there are two API calls that are related.

            1. The first call should be PUT /api/user/verify-email?email={email}.
            2. The second should be POST /api/user/verify-email?verificationId={verificationId} takes the verificationId obtained in the first call and marks the user as email verified via API.

            I spun up FusionAuth and was able to get this email to send by calling the API.

            Let's see if we can retrace our steps to find out what may be happening. To start, this was the command I ran and the result.

            curl --location --request PUT 'http://localhost:9011/api/user/verify-email?email=<my_email@my_email.com>' \
            --header 'Authorization: <API KEY>' \
            --header 'X-FusionAuth-TenantId: <TENANT_ID>'
            

            should return

            {
                "verificationId": "SOME_REALLY_LONG_ALPHANUMERIC_STRING"
            }
            

            status: 200

            I find it interesting that you are getting a 200 OK, and no response body.

            Have you verified that you have verify registration set up (toggled) on the Tenant and Application level (the application level is optional, depending on the behavior you want for your customers) as well as the ability to send a test email in the SMTP setting under the tenant?

            if you have those three things configured, as well as an appropriately provisioned API key and correct tenant ID, the above cURL command has a high chance of working for you.

            If this is still not working, any other recreate steps might be helpful in diagnosing.

            Below are some over annotated screenshots that might help 🙂
            tenant-orginal.png
            application-original-orginal.png

            I will let you know if I can think of anything else in the meantime.

            Thanks,
            Josh

            1 Reply Last reply Reply Quote 0
            • A Alex Patterson referenced this topic on
            • First post
              Last post