question

brandondmobile avatar image
brandondmobile asked

Using custom account recovery email template doesn't work

unity3d
1 comment
10 |1200

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

brandondmobile avatar image brandondmobile commented ·

I am trying to use a custom recovery email to send players a password reset link. I've made sure that my users assign their contact email on top of their sign in email. Using the SendAccountRecoveryEmail client API in the newest Unity SDK results in the AccountNotFound error, despite using an email I know my test account has as their contact email.

I also tried using the API from your website (https://api.playfab.com/documentation/client/method/SendAccountRecoveryEmail) but I get an unexpected error, attached.

I also tried using https://api.playfab.com/documentation/server/method/SendEmailFromTemplate and https://api.playfab.com/documentation/server/method/SendCustomAccountRecoveryEmail but both "Call API" buttons did absolutely nothing.

I also want to mention that manually assigning the contact email in the dashboard results in a "Internal Server Error" (attached, I used a fake email in the attachment but using a real email doesn't work either) but the client API works just fine.

https://www.dropbox.com/s/1szjfmqz4teom0m/ClientError.jpg?raw=1

https://www.dropbox.com/s/wkftiro39mpde4y/ServerError.PNG?raw=1

0 Likes 0 ·
brendan avatar image
brendan answered

So, account login and account recovery are done using the Master Account email address, while template emails are sent to the player at the title-level contact email address. I haven't seen the TryIt fail in the way you're describing, though - I take it all your tests are on Title ID 3E94?

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.

brendan avatar image brendan commented ·

Hm. I just tried the TryIt functionality, and I can't reproduce that. Can you copy your Title ID into Notepad (or similar), and copy/paste it from there, to make sure you don't have any extraneous control characters?

0 Likes 0 ·
brandondmobile avatar image brandondmobile commented ·

that is correct. I had some limited success using another title but considering that this is the title I need it to work in I spent the most time testing in there.

0 Likes 0 ·
brandondmobile avatar image
brandondmobile answered

As there are multiple issues in this one post I will break down my experience so that each is separate:

Using the https://api.playfab.com/documentation/client/method/SendAccountRecoveryEmail API
copying my title ID into the TitleId field doesn't work. I've even tried manually typing in my Title ID so there are absolutely no control characters. Regardless of if the email is valid or not I always get "TitleId: must be a hex-encoded number"

https://api.playfab.com/documentation/server/method/SendEmailFromTemplate

https://api.playfab.com/documentation/server/method/SendCustomAccountRecoveryEmail

The "Call API" button does _nothing_. I've tried both Edge and Chrome but clicking the button does not execute the server API. There are no errors, literally nothing happens.

Finally. Using SecondAccountRecoveryEmail from my client (so not from your site) yields the result "AccountNotFound" error. As you mentioned that uses Master Account email address while the templates use the title specific email address. I am accounting for that in all of my tests. I am using a test account with identical Master Account and Contact email addresses.

If it helps the user I am testing with is 192D734C13D12996, the title ID is 3E94, and my publisher ID is ECBE7283E7D1123A

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.

brendan avatar image brendan commented ·

Ah, interesting. The site isn't correctly turning your Title ID into a string, for some reason. If you add quote marks to it, it does work fine ("3E94" rather than just 3E94). I'll file a bug to get that fixed, but that'll get you past the issue.

For the template issue, what is the ID of the template and the PlayFab ID of the user you're testing (it that also 192D734C13D12996)?

For the call from the client, I just tested that, using the two email addresses (different only by case) for that account, and since it's the same email address (again, just case difference), it worked both times. Can you try putting in a breakpoint and checking the specifics of the values you're passing into the parameters?

0 Likes 0 ·
brandondmobile avatar image brandondmobile brendan commented ·

The template is 578E2565EA1E8DE3.

I updated my client and it seems to be working now. I'm getting SmtpServerGeneralFailure from the server but I think that's on my end not yours. As long as I can get the Smtp add-on to work then I shouldn't need the server APIs, but you should definitely get them fixed for the next person.

0 Likes 0 ·
brendan avatar image brendan brandondmobile commented ·

Got it - so there wasn't an issue with the template after all, it was just the inability of the TryIt functionality to accept your Title ID? We do have a bug open on that, so we should get it fixed shortly.

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.