question

oy2030024 avatar image
oy2030024 asked

" SendAccountRecoveryEmail: HTTP/1.1 500 Internal Server Error " Account Recovery not working.

I tried making a method for the player to recover their account but it does not work for some reason. the code:

 public TMP_InputField recoveryEmailInput;
 public TextMeshProUGUI messageText;
    
 public void ResetPasswordButton()
     {
         var request = new SendAccountRecoveryEmailRequest
         {
             Email = recoveryEmailInput.text,
             TitleId = "322C2"
         };
         PlayFabClientAPI.SendAccountRecoveryEmail(request, OnPasswordReset, OnError);
     }
    
     void OnPasswordReset(SendAccountRecoveryEmailResult result)
     {
         messageText.text = "Password recovery mail sent!";
     }
    
     void OnError(PlayFabError error)
     {
         Debug.Log("Error while logging in/Creating account!");
         Debug.Log(error.GenerateErrorReport());
         messageText.text = error.ErrorMessage;
     }

PS. The above is only a PART of a bigger script. the above is just the part of that script that's responsible for account recovery

I have tried all of the following:

  • I have checked the Input field multiple times to make sure it's attached to the script.

  • I have checked the button to make sure it's calling the correct function (which is ResetPasswordButton).

  • I made sure that every word was spelled correctly.

  • the email Im entering in the Input field is attached to an account and can have emails sent to it.

  • I have tried multiple emails.

  • I have checked countless times that my Title Id is correct.

Every time, the result is always the same and it ends up giving me this error:

 /Client/SendAccountRecoveryEmail: HTTP/1.1 500 Internal Server Error
 UnityEngine.Debug:Log (object)
 PlayfabManager:OnError (PlayFab.PlayFabError) (at Assets/Scripts/PlayfabManager.cs:53)
 PlayFab.Internal.PlayFabUnityHttp:OnError (string,PlayFab.Internal.CallRequestContainer) (at Assets/PlayFabSDK/Shared/Internal/PlayFabHttp/PlayFabUnityHttp.cs:237)
 PlayFab.Internal.PlayFabUnityHttp/<Post>d__12:MoveNext () (at Assets/PlayFabSDK/Shared/Internal/PlayFabHttp/PlayFabUnityHttp.cs:151)
 UnityEngine.SetupCoroutine:InvokeMoveNext (System.Collections.IEnumerator,intptr)

I have searched and found someone facing the same problem, but it was because TextMeshPro would have an extra hidden character. But even when I changed the Input field to legacy, the same error would happen.

Any help would be appreciated.

apisAccount Managementsupport
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

The API SendAccountRecoveryEmail seems to have an issue, which requires an EmailTemplateId to be set in the request body to work properly, otherwise it will give an error: "HTTP/1.1 500 Internal Server Error".

This issue is currently fixed and you can try again without set EmailTemplateId. It will send PlayFab's default password reset website. Also, If you want to send your custom email template, you can refer to Create an email template.

3 comments
10 |1200

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

oy2030024 avatar image oy2030024 commented ·

I thought SendAccountRecoveryEmail uses the default email template; therefore, I didn't need to make a custom one.

I still need to figure out how costume email templates work.

I attempted to make one, and the game says an email has been sent. But no email is being sent to me.

I have tried looking into this, but there is a part that I don't understand about it, which is "From Email Address: The email address you want to show in the From field in the email. This must be an email domain that the SMTP server enables you to send emails from.".

I have installed the SMTP server add-on, but what kind of email do I enter in the email template? Like, an email that I have access to? Or any email that I want?

Also, I have added a contact email for the player.

Thanks for your help so far!

1 Like 1 ·
Neils Shi avatar image Neils Shi oy2030024 commented ·

There is a part that I don't understand about it, which is "From Email Address". I have installed the SMTP server add-on, but what kind of email do I enter in the email template? Like, an email that I have access to? Or any email that I want?

The document says the "From Email Address" will be shown in the From field in the email and it must be an email domain that the SMTP server enables you to send emails from. So, you should Set it to the sender's mail address.

I attempted to make one, and the game says an email has been sent. But no email is being sent to me.

You can keep the PlayStream(navigate to "Game Manager" -> "Title Overview" -> "PlayStream Monitor") web page open to monitor the events generating and check the event detail.

1 Like 1 ·
oy2030024 avatar image oy2030024 Neils Shi commented ·

Okay, I solved it, thankfully, After seeing the error in the playstream. I figured out that I needed an app password for the SMTP server to have access to my account. I never even knew that app passwords existed before this, haha.

Thanks for your help, mate! Cheers!

0 Likes 0 ·

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.