Add: send mail - maestro upgrade

This commit is contained in:
2018-09-20 17:34:54 +09:00
parent bffc63996a
commit a27eaa37d2
8 changed files with 361 additions and 123 deletions
+141 -32
View File
@@ -1,48 +1,60 @@
<?php
function makeMailHeader($from, $bcc) {
global $new_line;
return "From:".$from.$new_line."BCC:".$bcc;
}
////////////////////////////////////////
// 마에스트로 계정 신청 - 입금 안내
function sendMailBankInfo($maestro_name, $mail_to, $account_type) {
function sendMailRegisterBankInfo($maestro_name, $mail_to, $account_type) {
global $from, $bcc;
header("Content-Type: text/html; charset=UTF-8");
// $subject = subjectInfoBankAccountForRegisteringMaestro($maestro_name);
// $message = messageInfoBankAccountForRegisteringMaestro($maestro_name, $account_type);
// $header = "From:".$from.$new_line."BCC:".$bcc;
// mb_send_mail($mail_to, $subject, $message, $header);
mb_send_mail(
$mail_to,
subjectBankInfo($maestro_name),
messageBankInfo($maestro_name, $account_type),
subjectRegisterBankInfo($maestro_name),
messageRegisterBankInfo($maestro_name, $account_type),
makeMailHeader($from, $bcc)
);
header("Content-Type: application/json");
}
function subjectBankInfo($maestro_name) {
return "[초코마에] 마에스트로 계정 (".$maestro_name.") 등록을 위한 입금 안내";
function subjectRegisterBankInfo($maestro_name) {
return "[초코마에] ".$maestro_name." - 마에스트로 계정 등록을 위한 입금 안내";
};
function messageBankInfo($maestro_name, $account_type) {
function messageRegisterBankInfo($maestro_name, $account_type) {
global $new_line, $bank_name, $bank_account_no, $bank_owner_name;
return "안녕하세요.".$new_line."[초코마에] 마에스트로 계정을 신청해 주셔서 감사합니다.".$new_line
$price = number_format(get_price($account_type));
return "안녕하세요.".$new_line.
"[초코마에] 마에스트로 계정을 신청해 주셔서 감사합니다.".$new_line
.$new_line
."※ 지금 보고 계신 메일이 [스팸 메일함]에 들어있다면, [스팸 해제]를 부탁드립니다 ※".$new_line
."(이후에 [계정 등록 알림], [계정 유효기간 종료 예고] 등의 메일이 발송됩니다)".$new_line
.$new_line
.$new_line
."[".$maestro_name."] 마에스트로 계정을 활성화 하기 위한 은행 계좌 정보는 아래와 같습니다.".$new_line
."------------------------------------------------------------".$new_line
." * 은행 계좌 : ".$bank_account_no." ( ".$bank_name." )".$new_line
." * 예금주명 : ".$bank_owner_name.$new_line
." * 금액 : ".get_price($account_type)."".$new_line
."신청하신 마에스트로 계정 내용은 아래와 같습니다.".$new_line
."1) 아이디 : ".$maestro_name.$new_line
."2) 요금제 : ".get_accout_type($account_type).$new_line
.$new_line
."계정 등록을 위한 은행 계좌 입금 정보는 아래와 같습니다.".$new_line
."------------------------------------------------------------".$new_line
." * 은행 계좌 : ".$bank_account_no." ( ".$bank_name.", 예금주 : ".$bank_owner_name." )".$new_line
." * 금액 : ".$price."".$new_line
." * 송금자명 : ".$maestro_name." (신청하신 마에스트로 아이디)".$new_line
." ☞ 빠른 입금 확인을 위해, 송금자명을 본인 이름 대신 위와 같이 아이디로 부탁드립니다 ☜".$new_line
."------------------------------------------------------------".$new_line
.$new_line
."* 혹시 신청하신 아이디가 아니라 본인 이름등으로 송금되었다면, 송금자명을 본 메일로 답신 부탁드립니다.".$new_line
.$new_line
."* 계정이 활성화되면 1년동안 사용하실 수 있습니다.".$new_line
."* 연장 결제를 해주시면, 남은 기간에 1년이 추가됩니다.".$new_line
."* 상위 요금제로 업그레이드 하셔도, 현재 계정의 남은 기간에 1년이 추가됩니다.".$new_line
@@ -58,44 +70,43 @@ function messageBankInfo($maestro_name, $account_type) {
////////////////////////////////////////
// 마에스트로 계정 활성화 안내
function sendMailRegistered($maestro_name, $mail_to) {
function sendMailRegisterDone($maestro_name, $mail_to) {
global $from, $bcc;
header("Content-Type: text/html; charset=UTF-8");
// $subject = subjectInfoBankAccountForRegisteringMaestro($maestro_name);
// $message = messageInfoBankAccountForRegisteringMaestro($maestro_name, $account_type);
// $header = "From:".$from.$new_line."BCC:".$bcc;
// mb_send_mail($mail_to, $subject, $message, $header);
mb_send_mail(
$mail_to,
subjectRegistered($maestro_name),
messageRegistered($maestro_name),
subjectRegisterDone($maestro_name),
messageRegisterDone($maestro_name),
makeMailHeader($from, $bcc)
);
header("Content-Type: application/json");
}
function subjectRegistered($maestro_name) {
return "[초코마에] 마에스트로 계정 (".$maestro_name.") 등록 및 활성화 완료";
function subjectRegisterDone($maestro_name) {
return "[초코마에] ".$maestro_name." - 마에스트로 계정 등록 및 활성화 완료";
};
function messageRegistered($maestro_name) {
function messageRegisterDone($maestro_name) {
global $new_line, $bank_name, $bank_account_no, $bank_owner_name;
return "안녕하세요.".$new_line."[초코마에] 마에스트로 계정을 신청해 주셔서 감사합니다.".$new_line
return "안녕하세요.".$new_line.
"[초코마에] 마에스트로 계정을 신청해 주셔서 감사합니다.".$new_line
.$new_line
."※ 지금 보고 계신 메일이 [스팸 메일함]에 들어있다면, [스팸 해제]를 부탁드립니다 ※".$new_line
."(이후에 [계정 유효기간 종료 예고], [계정 업그레이드] 등의 메일이 발송됩니다)".$new_line
.$new_line
.$new_line
."[".$maestro_name."] 마에스트로 계정이 활성화 되었습니다.".$new_line
.$maestro_name." - 마에스트로 계정이 활성화 되었습니다.".$new_line
.$new_line
."* 계정이 활성화되면 1년동안 사용하실 수 있습니다.".$new_line
."* 연장 결제를 해주시면, 남은 기간에 1년이 추가됩니다.".$new_line
."* 상위 요금제로 업그레이드 하셔도, 현재 계정의 남은 기간에 1년이 추가됩니다.".$new_line
."* 상위 요금제로 업그레이드 하시면, 현재 계정의 남은 기간에 1년이 추가됩니다.".$new_line
."* 비활성화된 계정과 그 안에 있는 모든 정보는, 6개월 후에 자동 삭제됩니다.".$new_line
.$new_line
.$new_line
@@ -108,10 +119,108 @@ function messageRegistered($maestro_name) {
function makeMailHeader($from, $bcc) {
global $new_line;
return "From:".$from.$new_line."BCC:".$bcc;
////////////////////////////////////////
// 마에스트로 업그레이드 신청 - 입금 안내
function sendMailUpgradeBankInfo($maestro_name, $mail_to, $account_type, $upgrade_account_type) {
global $from, $bcc;
header("Content-Type: text/html; charset=UTF-8");
mb_send_mail(
$mail_to,
subjectUpgradeBankInfo($maestro_name),
messageUpgradeBankInfo($maestro_name, $account_type, $upgrade_account_type),
makeMailHeader($from, $bcc)
);
header("Content-Type: application/json");
}
function subjectUpgradeBankInfo($maestro_name) {
return "[초코마에] ".$maestro_name." - 마에스트로 계정 업그레이드를 위한 입금 안내";
};
function messageUpgradeBankInfo($maestro_name, $account_type, $upgrade_account_type) {
global $new_line, $bank_name, $bank_account_no, $bank_owner_name;
$price = number_format(get_price($upgrade_account_type) - get_price($account_type));
return "안녕하세요.".$new_line.
"[초코마에] 마에스트로 계정 요금제 업그레이드를 신청해주셔서 감사합니다.".$new_line
.$new_line
."※ 지금 보고 계신 메일이 [스팸 메일함]에 들어있다면, [스팸 해제]를 부탁드립니다 ※".$new_line
."(이후에 [계정 등록 알림], [계정 유효기간 종료 예고] 등의 메일이 발송됩니다)".$new_line
.$new_line
.$new_line
.$maestro_name." - 마에스트로 계정의 현재 요금제와 업그레이드 요금제는 아래와 같습니다.".$new_line
."1) 현재 사용중인 요금제 : ".get_accout_type($account_type).$new_line
."2) 신청하신 업그레이드 요금제 : ".get_accout_type($upgrade_account_type).$new_line
.$new_line
.$new_line
."계정 요금제 업그레이드를 위한 은행 계좌 입금 정보는 아래와 같습니다.".$new_line
."------------------------------------------------------------".$new_line
." * 은행 계좌 : ".$bank_account_no." ( ".$bank_name.", 예금주 : ".$bank_owner_name." )".$new_line
." * 금액 : ".$price."".$new_line
." * 송금자명 : ".$maestro_name." (신청하신 마에스트로 아이디)".$new_line
." ☞ 빠른 입금 확인을 위해, 송금자명을 본인 이름 대신 위와 같이 아이디로 부탁드립니다 ☜".$new_line
."------------------------------------------------------------".$new_line
.$new_line
."* 혹시 신청하신 아이디가 아니라 본인 이름등으로 송금되었다면, 송금자명을 본 메일로 답신 부탁드립니다.".$new_line
.$new_line
."* 상위 요금제로 업그레이드 하시면, 현재 계정의 남은 기간에 1년이 추가됩니다.".$new_line
."* 비활성화된 계정과 그 안에 있는 모든 정보는, 6개월 후에 자동 삭제됩니다.".$new_line
.$new_line
.$new_line
."계정 신청 내역과 입금 내역이 확인되는대로 마에스트로 아이디를 업그레이드 해드리겠습니다.".$new_line
."현재 수작업으로 확인하고 활성화하고 있어서 시간이 조금 걸리는 점 양해 부탁드립니다.".$new_line
."마에스트로 계정이 업그레이드 되는대로, 즉시 알림 메일을 드리겠습니다.".$new_line
.$new_line
."감사합니다.".$new_line;
}
////////////////////////////////////////
// 마에스트로 업그레이드 완료 안내
function sendMailUpgradeDone($maestro_name, $mail_to, $account_type, $upgrade_account_type) {
global $from, $bcc;
header("Content-Type: text/html; charset=UTF-8");
mb_send_mail(
$mail_to,
subjectUpgradeDone($maestro_name),
messageUpgradeDone($maestro_name, $account_type, $upgrade_account_type),
makeMailHeader($from, $bcc)
);
header("Content-Type: application/json");
}
function subjectUpgradeDone($maestro_name) {
return "[초코마에] ".$maestro_name." - 마에스트로 계정의 요금제 업그레이드 완료 알림";
};
function messageUpgradeDone($maestro_name, $account_type, $upgrade_account_type) {
global $new_line, $bank_name, $bank_account_no, $bank_owner_name;
return "안녕하세요.".$new_line.
"[초코마에] 마에스트로 계정 요금제 업그레이드를 신청해주셔서 감사합니다.".$new_line
.$new_line
."※ 지금 보고 계신 메일이 [스팸 메일함]에 들어있다면, [스팸 해제]를 부탁드립니다 ※".$new_line
."(이후에 [계정 유효기간 종료 예고], [계정 업그레이드] 등의 메일이 발송됩니다)".$new_line
.$new_line
.$new_line
.$maestro_name." - 마에스트로 계정의 요금제가 [ ".get_accout_type($account_type)." ] 에서 [ ".get_accout_type($upgrade_account_type)." ] 로 업그레이드 되었습니다.".$new_line
.$new_line
."* 마에스트로 계정 유효기간이 업그레이드 되기 전 남은 기간 + 추가 1년으로 설정되었습니다.".$new_line
.$new_line
.$new_line
."등록하신 마에스트로 계정 정보는 마에스트로 로그인 후, [계정 정보 수정] 화면에서 변경이 가능합니다.".$new_line
."(변경 가능 정보 : 마에스트로 아이디, 이메일, 암호)".$new_line
.$new_line
."감사합니다.".$new_line;
}
?>
+43 -13
View File
@@ -16,11 +16,25 @@ $email = $_POST["email"];
$account_type = $_POST["account_type"];
$upgrade_account_type = $_POST["upgrade_account_type"];
// set_data("maestro_name", $maestro_name);
// set_data("email", $email);
// set_data("account_type", $account_type);
// set_data("upgrade_account_type", $upgrade_account_type);
if($type == "sendMailBankInfo") {
sendMailBankInfo($maestro_name, $email, $account_type);
if($type == "sendMailRegisterBankInfo") {
sendMailRegisterBankInfo($maestro_name, $email, $account_type);
/*
// subject registered
$subject = subjectRegisterBankInfo($maestro_name);
set_data("subject", $subject);
// messgae registered
$messgae = messageRegisterBankInfo($maestro_name, $account_type, $upgrade_account_type);
set_data("messgae", $messgae);
*/
} else if($type == "sendMailRegistered") {
sendMailRegistered($maestro_name, $email, $account_type);
sendMailRegisterDone($maestro_name, $email, $account_type);
/*
// maestro data
@@ -28,26 +42,42 @@ if($type == "sendMailBankInfo") {
set_data("maestroData", $maestro_data);
// subject registered
$subject = subjectRegistered($maestro_data["name"]);
$subject = subjectRegisterDone($maestro_data["name"]);
set_data("subject", $subject);
// messgae registered
$messgae = messageRegistered($maestro_data["name"]);
$messgae = messageRegisterDone($maestro_data["name"]);
set_data("messgae", $messgae);
*/
} else if($type == "sendMailUpgradeBankInfo") {
sendMailUpgradeBankInfo($maestro_name, $email, $account_type, $upgrade_account_type);
/*
// subject registered
$subject = subjectUpgradeBankInfo($maestro_name);
set_data("subject", $subject);
// messgae registered
$messgae = messageUpgradeBankInfo($maestro_name, $account_type, $upgrade_account_type);
set_data("messgae", $messgae);
*/
} else if($type == "sendMailUpgradeDone") {
sendMailUpgradeDone($maestro_name, $email, $account_type, $upgrade_account_type);
/*
// subject upgrade bank info
$subject = subjectUpgradeDone($maestro_name);
set_data("subject", $subject);
// messgae upgrade bank info
$messgae = messageUpgradeDone($maestro_name, $account_type, $upgrade_account_type);
set_data("messgae", $messgae);
*/
} else if($type == "get_maestro_data") {
// maestro data
$maestro_data = get_maestro_data($maestro_id);
set_data("maestroData", $maestro_data);
// subject registered
$subject = subjectRegistered($maestro_data["name"]);
set_data("subject", $subject);
// messgae registered
$messgae = messageRegistered($maestro_data["name"]);
set_data("messgae", $messgae);
}
send_result_success();