question

justindooley avatar image
justindooley asked

SendAccountRecoveryEmail does not send template

I'm sending a email via the client api to recover a password. But even though I'm sending a template ID I get a standard link to the playfab servers instead of my email template and custom field entry on my site.


function SendAccountRecoveryEmail( )
{
	var AccountRecoveryEmailRequest = {
		"Email": document.getElementById("loginEmail").value,
		"EmailTemplateId ": "3FFE691C47D885BB",
		"TitleId": PlayFab.settings.titleId
	};
	
	PlayFabClientSDK.SendAccountRecoveryEmail(AccountRecoveryEmailRequest, SendAccountRecoveryEmailCallback );
}


var SendAccountRecoveryEmailCallback = function (result, error) {
	if(result !== null)
	{
		//location.reload();
		console.log(result);
	}
	else if (error !== null) {
        console.log(PlayFab.GenerateErrorReport(error));
    }
};
5 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.

Seth Du avatar image Seth Du ♦ commented ·

I have tested it in my title and my email template seems to work fine. Can you share some information of sent_email event in PlayerStream? Make sure you hide sensitive information.

0 Likes 0 ·
justindooley avatar image justindooley Seth Du ♦ commented ·

Sorry for the delay, Holidays and all. I don't get an email sent I get a password reset sent:

{
    "EventName": "player_password_reset_link_sent",
    "RecoveryEmailAddress": "█████████████████",
    "InitiatedFromIPAddress": "█████████████████",
    "InitiatedBy": "Self",
    "PasswordResetId": "█████████████████",
    "LinkExpiration": "2018-12-27T23:35:43.9302994Z",
    "EventNamespace": "com.playfab",
    "EntityType": "player",
    "Source": "PlayFab",
    "TitleId": "████",
    "EntityId": "█████████████████",
    "EventId": "█████████████████",
    "SourceType": "BackEnd",
    "Timestamp": "2018-12-27T22:35:43.9302994Z",
    "History": null,
    "CustomTags": null,
    "Reserved": null,
    "PlayFabEnvironment": {
        "Vertical": "master",
        "Cloud": "main",
        "Application": "mainserver",
        "Commit": "ba162a8"
    }
}
0 Likes 0 ·
Seth Du avatar image Seth Du ♦ justindooley commented ·

How do you generate this event? if you simply call SendAccountRecoveryEmail, the event name should be set by PlayFab which is 'sent_email', as you can see on https://api.playfab.com/docs/tutorials/landing-players/using-email-templates-to-send-an-account-recovery-email. Here is an example:

The Body part is the template you input. Hence, can you describe the account recovery work flow for us. In addition, can you provide your title ID so that we can look into it.

0 Likes 0 ·
Show more comments
Show more comments

1 Answer

·
brendan avatar image
brendan answered

What is the Title ID, so that we can have a look at the specifics?

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

justindooley avatar image justindooley commented ·

2364 is the title id

0 Likes 0 ·
brendan avatar image brendan justindooley commented ·

I created a player account in your title and tried both Client/SendAccountRecoveryEmail, as well as Server/SendCustomAccountRecoveryEmail. Both send me your custom email, with a link to your page. Can you provide the specific body of the command you're passing into the call (using Postman)? Feel free to remove the email address, and just give us the PlayFab ID of the user, so that we can look it up.

0 Likes 0 ·
justindooley avatar image justindooley brendan commented ·

Using postman I get the correct email. using a javascript call, it seems to fall back on the other one. This is the body in postman:

{
  "Email": "{
                     {EmailForId 3015B56F76E2769}}",
  "TitleId": "{
                     {TitleId}}",
  "EmailTemplateId": "3FFE691C47D885BB"
}

Compared to what I'm calling in my javascript seen above.

0 Likes 0 ·
Show more comments
Show more comments

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.