/// <summary> /// Forces an email to be sent to the registered email address for the specified account, with a link allowing the user to change the password /// </summary> public static void SendAccountRecoveryEmail(SendAccountRecoveryEmailRequest request, SendAccountRecoveryEmailCallback resultCallback, ErrorCallback errorCallback, object customData = null) { if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); string serializedJSON = JsonConvert.SerializeObject(request, Util.JsonFormatting, Util.JsonSettings); Action<string,PlayFabError> callback = delegate(string responseStr, PlayFabError pfError) { SendAccountRecoveryEmailResult result = null; ResultContainer<SendAccountRecoveryEmailResult>.HandleResults(responseStr, ref pfError, out result); if(pfError != null && errorCallback != null) { errorCallback(pfError); } if(result != null) { result.CustomData = customData; result.Request = request; if(resultCallback != null) { resultCallback(result); } } }; PlayFabHTTP.Post(PlayFabSettings.GetURL()+"/Admin/SendAccountRecoveryEmail", serializedJSON, "X-SecretKey", PlayFabSettings.DeveloperSecretKey, callback); }
/// <summary> /// Forces an email to be sent to the registered email address for the user's account, with a link allowing the user to change the password /// </summary> public static void SendAccountRecoveryEmail(SendAccountRecoveryEmailRequest request, SendAccountRecoveryEmailCallback resultCallback, ErrorCallback errorCallback) { string serializedJSON = JsonConvert.SerializeObject(request, Util.JsonFormatting, Util.JsonSettings); Action<string,string> callback = delegate(string responseStr, string errorStr) { SendAccountRecoveryEmailResult result = null; PlayFabError error = null; ResultContainer<SendAccountRecoveryEmailResult>.HandleResults(responseStr, errorStr, out result, out error); if(error != null && errorCallback != null) { errorCallback(error); } if(result != null) { if(resultCallback != null) { resultCallback(result); } } }; PlayFabHTTP.Post(PlayFabSettings.GetURL()+"/Client/SendAccountRecoveryEmail", serializedJSON, null, null, callback); }
/// <summary> /// Forces an email to be sent to the registered email address for the user's account, with a link allowing the user to change the password /// </summary> public static void SendAccountRecoveryEmail(SendAccountRecoveryEmailRequest request, SendAccountRecoveryEmailCallback resultCallback, ErrorCallback errorCallback, object customData = null) { string serializedJson = JsonConvert.SerializeObject(request, Util.JsonFormatting, Util.JsonSettings); Action<CallRequestContainer> callback = delegate(CallRequestContainer requestContainer) { ResultContainer<SendAccountRecoveryEmailResult>.HandleResults(requestContainer, resultCallback, errorCallback, null); }; PlayFabHTTP.Post("/Client/SendAccountRecoveryEmail", serializedJson, null, null, callback, request, customData); }