question

krishnab avatar image
krishnab asked

how to reset password or forgot password in unity.

Hello, I was trying to use forgot password api, but not able to get any email from the forgot password api. I am using this method mentioned below to reset my password: private void ResetPassword() { var request = new SendAccountRecoveryEmailRequest { Email = emailAddress, EmailTemplateId = emailTemplateId, TitleId = titleId // game id };

     PlayFabClientAPI.SendAccountRecoveryEmail(request, res =>
     {
         Debug.Log("An account recovery email has been sent to the player's email address.\n" + 
         res.ToJson());
         forgotPopUp.SetActive(true);
     }, FailureCallback);

}

any suggestion what i am doing wrong.

apis
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Neils Shi avatar image
Neils Shi answered

According to the code you provided, since you specified the “EmailTemplateId” in the API request, then PlayFab will send the recovery email to the contact email address (even if you are using login email in the API request). Please make sure that players have the contact email (which is different from the login email). Players can call API AddOrUpdateContactEmail to add or update their contact email. And you should also make sure that you have followed the document Setting up an SMTP server with Add-ons - PlayFab | Microsoft Learn to set up your SMTP server. In addition, did you receive any error messages? If so, could you provide the error message with us so that we can do some research.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.