(function () { SendEmailHandler = function () { function ajaxParamsObj(action, successHandler, errorHandler) { this.url = '/_ajax/SendEmailHandler.ashx'; this.type = 'POST'; this.contentType = 'application/x-www-form-urlencoded; charset=UTF-8'; //.NET Request object like query string format this.dataType = 'json'; //javascript likes objects this.data = { action: action }; this.onSuccess = successHandler; this.onError = errorHandler; this.success = function (response) { if (this.onSuccess != null) this.onSuccess(response); } this.error = function (xhr, status, error) { if (this.onError != null) this.onError(error); } } this.SendGetMobileAppEmail = function (emailTo, pTzlocale, successHandler, errorHandler) { var ajaxParams = new ajaxParamsObj("SendGetMobileAppEmail", successHandler, errorHandler); ajaxParams.data.to = emailTo; ajaxParams.data.tzlocale = pTzlocale; $.ajax(ajaxParams); } this.SendGetIPhoneAppEmail = function (emailTo, pTzlocale, successHandler, errorHandler) { var ajaxParams = new ajaxParamsObj("SendGetIPhoneAppEmail", successHandler, errorHandler); ajaxParams.data.to = emailTo; ajaxParams.data.tzlocale = pTzlocale; $.ajax(ajaxParams); } this.SendGetAndroidAppEmail = function (emailTo, pTzlocale, successHandler, errorHandler) { var ajaxParams = new ajaxParamsObj("SendGetAndroidAppEmail", successHandler, errorHandler); ajaxParams.data.to = emailTo; ajaxParams.data.tzlocale = pTzlocale; $.ajax(ajaxParams); } } })();