Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Sending account recovery emails with PlayFab?

Discussion in 'Multiplayer' started by MidniteOil, Aug 4, 2021.

  1. MidniteOil

    MidniteOil

    Joined:
    Sep 25, 2019
    Posts:
    345
    Edit: I was able to get the default account recovery form working. I'd still like an answer to point #2: Are there verification emails for the login email (as opposed to the contact email)?

    Greetings,

    I'm in the processing of implementing authentication in my multiplayer game and I've decided to use PlayFab.
    The game server is hosted on an AWS Linux instance and the client is currently a WebGL client hosted on an Amazon S3 bucket.

    I'm using Mirror for networking.

    I've got signing up new users and logging in working and am now working on account verification and recovery.

    I have a few questions:

    1. For account recovery, I see from the PlayFab dashboard I can just navigate to a user and check the Send password reset email checkbox and click Save all changes:
    upload_2021-8-4_10-11-3.png

    I immediately receive the password reset email:
    upload_2021-8-4_10-11-26.png
    The link in the email takes me to a page on playfab.com where I can enter a new password:
    upload_2021-8-4_10-20-5.png

    Since this already works "out-of-the-box", why am I required to create email templates, setup my own smtp server and host a web site to make the api call to reset the password?

    2. It appears that the email verification api calls only work for contact email, not the email used to login with? Is that correct? I would like to require new users to verify their email before I allow them to login.

    3. When trying to make a SendAccountRecoverEmail() call I keep getting invalid input parameters error.
    upload_2021-8-4_10-26-2.png
    I've verified that the TitleId and EmailTemplateId are correct and the email address is a valid email address. What am I doing wrong there?

    Thank in advance,

    -Midnite.
     

    Attached Files:

    Last edited: Aug 18, 2021
  2. SpaharGR

    SpaharGR

    Joined:
    Dec 5, 2012
    Posts:
    11
    Just implementing this feature and came across your post. Probably you have found a solution by now, but just in case.

    According to this answer in playfab community, in order to use PlayFab's default reset form (the one in the third image above) you should not pass "EmailTemplate" param in SendAccountRecoveryEmail, just provide TitleId and Email.

    It worked for me.
     
    MidniteOil likes this.
  3. MidniteOil

    MidniteOil

    Joined:
    Sep 25, 2019
    Posts:
    345
    Thanks for the reply. I had not found a solution yet so I'm looking forward to giving that a try.

     
  4. MidniteOil

    MidniteOil

    Joined:
    Sep 25, 2019
    Posts:
    345
    I refactored to omit the email template and discovered that I actually wired my button click handler to the wrong class and was sending a blank email address which was why I was getting the invalid input parameters error.

    Regardless, it works with the the default reset form which is good enough for now.

    Thanks again for the reply.