question

jack90325 avatar image
jack90325 asked

How can I get the default account recovery email token?

I follow this tutorial to send an account recovery email and reset the password on the Azure function. https://community.playfab.com/questions/44653/how-to-build-a-custom-server-to-the-playfab-admin.html

The question is can I get the token from the default account recovery email? Is it the reset token or in other places? "token=a663d33d5f8d97c8" I used this token to call resetpasswordAPI on the Azure function, but it didn't work. 6688-image.png 6695-image.png

apis
image.png (17.6 KiB)
image.png (8.8 KiB)
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 token from the default account recovery email (no Email TemplateId is specified) cannot be used with API ResetPassword, because the default account recovery link already implemented the reset password UI and features, you don’t need to do anything. In the thread you mentioned, they used the token from the account recovery email which use Email TemplateId to send. For more information, you can refer to Using Email Templates to Send an Account Recovery Email - PlayFab | Microsoft Learn.

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

jack90325 avatar image jack90325 commented ·

Thank you for answering my question.

I use an Email Template to send the account recovery email.

 var clientApi = new PlayFabClientInstanceAPI(apiSettings);
 var SendAccountRecoveryEmailResponse = await clientApi.SendAccountRecoveryEmailAsync(new PlayFab.ClientModels.SendAccountRecoveryEmailRequest(){
        Email = emailaddress,
        TitleId = titleId,
        EmailTemplateId = "84528352F1044954"
 });

But the Email wasn't sent to the player. Is it because I cannot use the URL of the default account recovery link to be the Callback URL? or other factors?

Callback URL:https://player.playfab.com/account/resettitlepassword

0 Likes 0 ·
Neils Shi avatar image Neils Shi jack90325 commented ·

If you want to use the Email Template to send the account recovery email, do you follow the document Setting up an SMTP server with Add-ons - PlayFab | Microsoft Learn to set up your SMTP server? You may also check the event details of sending email via data explorer, if the email is not sent successfully, you can provide the error message with us so that we can do some research.

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.