Add: send mail - update maestro email / id

This commit is contained in:
jisangs committed 2018-10-23 14:24:02 +09:00
1 parent b901a51d11
commit e384627c54
6 files changed
+149 -11

No files matched your search

+42
View File
@@ -103,6 +103,44 @@ function sendMailUpgradeDone($maestro_name, $maestro_email, $account_type, $upgr
sendEmail($postParamData);
}
function sendMailUpdateMaestroName($maestro_name, $maestro_name_prev, $maestro_email) {
$postParamData = makeDefaultPostParamData($maestro_name, $maestro_email);
$postParamData["templateSid"] = "161";
$postParamData["parameters"] = array(
"maestro_name_prev" => $maestro_name_prev,
"maestro_name" => $maestro_name,
);
sendEmail($postParamData);
}
function sendMailUpdateMaestroEmail($maestro_name, $maestro_email, $maestro_email_prev) {
// send to new email
$postParamData = makeDefaultPostParamData($maestro_name, $maestro_email);
$postParamData["templateSid"] = "137";
$postParamData["parameters"] = array(
"maestro_email_prev" => $maestro_email_prev,
"maestro_email" => $maestro_email,
);
sendEmail($postParamData);
// send to previous email
$postParamDataPrev = makeDefaultPostParamData($maestro_name, $maestro_email_prev);
$postParamDataPrev["templateSid"] = "137";
$postParamDataPrev["parameters"] = array(
"maestro_email_prev" => $maestro_email_prev,
"maestro_email" => $maestro_email,
);
sendEmail($postParamDataPrev);
}
function sendEmail($postParamData) {
global $host_name_url, $request_url, $access_key, $secret_key, $api_key, $method, $request_id;
global $sender_name, $sender_address;
@@ -235,14 +273,18 @@ function cUrl($postParam, $timestamp, $signature) {
curl_close ($ch);
if($status_code == 200) {
set_data("sendmail_respond", $response);
set_data("sendmail_postParam", $postParam);
} else if($status_code == 201) {
set_data("sendmail_succeed", $response);
set_data("sendmail_postParam", $postParam);
} else {
set_data("sendmail_error", $response);
set_data("sendmail_error_postParam", $postParam);
}
} catch(Exception $E) {
set_data("sendmail_error", $E->lastResponse);
set_data("sendmail_error_postParam", $postParam);
}
}