Fix: include error

This commit is contained in:
2022-05-01 23:10:27 +09:00
parent 3922076ae7
commit 0f501acff6
9 changed files with 59 additions and 54 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ include "./../lib/send_reply_json.php";
include "./../lib/db_maestro.php";
include "./../lib/maestro_log.php";
include "./../lib/maestro_account_info.php";
include "./../mail/mail_setting.php";
// include "./../mail/mail_setting.php";
// include "./../mail/send_mail.php";
include "./../mail/send_naver_mail.php";
+1 -1
View File
@@ -6,7 +6,7 @@ include "./../setup/connect_db.php";
include "./../lib/maestro_account_info.php";
include "./../lib/db_maestro.php";
include "./../lib/maestro_log.php";
include "./../mail/mail_setting.php";
// include "./../mail/mail_setting.php";
// include "./../mail/send_mail.php";
include "./../mail/send_naver_mail.php";
+5 -2
View File
@@ -1,12 +1,15 @@
<?php
header("Content-Type: application/json");
error_reporting( E_ALL );
ini_set( "display_errors", 1 );
include "./../setup/connect_db.php";
include "./../lib/send_reply_json.php";
include "./../lib/maestro_account_info.php";
// include "./../lib/maestro_account_info.php";
include "./../lib/db_maestro.php";
include "./../lib/maestro_log.php";
include "./../mail/mail_setting.php";
// include "./../mail/mail_setting.php";
include "./../mail/send_naver_mail.php";
@@ -5,7 +5,7 @@ include "./../setup/connect_db.php";
include "./../lib/send_reply_json.php";
include "./../lib/db_maestro.php";
include "./../lib/maestro_account_info.php";
include "./../mail/mail_setting.php";
// include "./../mail/mail_setting.php";
// include "./../mail/send_mail.php";
include "./../mail/send_naver_mail.php";
@@ -5,7 +5,7 @@ include "./../setup/connect_db.php";
include "./../lib/send_reply_json.php";
include "./../lib/db_maestro.php";
include "./../lib/maestro_account_info.php";
include "./../mail/mail_setting.php";
// include "./../mail/mail_setting.php";
// include "./../mail/send_mail.php";
include "./../mail/send_naver_mail.php";
@@ -6,7 +6,7 @@ include "./../setup/connect_db.php";
include "./../lib/maestro_account_info.php";
include "./../lib/db_maestro.php";
include "./../lib/maestro_log.php";
include "./../mail/mail_setting.php";
// include "./../mail/mail_setting.php";
// include "./../mail/send_mail.php";
include "./../mail/send_naver_mail.php";
+9 -9
View File
@@ -9,12 +9,12 @@ $bodyMap['registrationBankInfo'] = "안녕하세요.<br/>".
"<br/>".
"신청하신 마에스트로 계정 내용은 아래와 같습니다.<br/>".
"1) 아이디 : {{maestro_name}}<br/>".
"2) 요금제 : {{student_count}}명 ({{price}}원)<br/>".
"2) 요금제 : {{student_count}}명 ({{price}}원)<br/>".
"<br/>".
"계정 등록을 위한 은행 계좌 입금 정보는 아래와 같습니다.<br/>".
"------------------------------------------------------------<br/>".
"* 은행 계좌 : {{bank_account_no}} ( 카카오뱅크, 예금주 : 박지상 )<br/>".
"* 금액 : {{price}}원<br/>".
"* 금액 : {{price}}원<br/>".
"* 송금자명 : {{maestro_name}} (신청하신 마에스트로 아이디)<br/>".
" ☞ 빠른 입금 확인을 위해, 송금자명을 본인 이름 대신 위와 같이 아이디로 부탁드립니다 ☜<br/>".
"------------------------------------------------------------<br/>".
@@ -75,7 +75,7 @@ $bodyMap['closedBetaRegistrationBankInfo'] = "안녕하세요.<br/>".
"<br/>".
"신청하신 마에스트로 계정 내용은 아래와 같습니다.<br/>".
"1) 아이디 : {{maestro_name}}<br/>".
"2) 요금제 : {{student_count}}명 ({{price}}원)<br/>".
"2) 요금제 : {{student_count}}명 ({{price}}원)<br/>".
"<br/>".
"계정 신청 내역이 확인되는대로 마에스트로 아이디를 활성화 해드리겠습니다.<br/>".
"현재 수작업으로 확인하고 활성화하고 있어서 시간이 조금 걸리는 점 양해 부탁드립니다.<br/>".
@@ -108,7 +108,7 @@ $bodyMap['extensionBankInfo'] = "안녕하세요.<br/>".
"[초코마에] 마에스트로 계정 유효기간 연장을 신청해주셔서 감사합니다.<br/>".
"<br/>".
"{{maestro_name}} - 마에스트로 계정의 현재 요금제와 유효기간은 아래와 같습니다.<br/>".
"1) 현재 사용중인 요금제 : {{student_count}}명 ({{price}}원)<br/>".
"1) 현재 사용중인 요금제 : {{student_count}}명 ({{price}}원)<br/>".
"2) 유효기간 : {{date}}<br/>".
"<br/>".
"연장을 신청하실 경우, 새로운 유효기간은 아래와 같습니다.<br/>".
@@ -117,7 +117,7 @@ $bodyMap['extensionBankInfo'] = "안녕하세요.<br/>".
"계정 유효기간 연장을 위한 은행 계좌 입금 정보는 아래와 같습니다.<br/>".
"------------------------------------------------------------<br/>".
"* 은행 계좌 : {{bank_account_no}} ( 카카오뱅크, 예금주 : 박지상 )<br/>".
"* 금액 : {{price}}원<br/>".
"* 금액 : {{price}}원<br/>".
"* 송금자명 : {{maestro_name}} (신청하신 마에스트로 아이디)<br/>".
" ☞ 빠른 입금 확인을 위해, 송금자명을 본인 이름 대신 위와 같이 아이디로 부탁드립니다 ☜<br/>".
"------------------------------------------------------------<br/>".
@@ -152,14 +152,14 @@ $bodyMap['upgradeBankInfo'] = "안녕하세요.<br/>".
"[초코마에] 마에스트로 계정 요금제 업그레이드를 신청해주셔서 감사합니다.<br/>".
"<br/>".
"{{maestro_name}} - 마에스트로 계정의 현재 요금제와 업그레이드 요금제는 아래와 같습니다.<br/>".
"1) 현재 사용중인 요금제 : {{prev_student_count}}명 ({{prev_price}}원)<br/>".
"2) 신청하신 업그레이드 요금제 : {{upgrade_student_count}}명 ({{upgrade_price}}원)<br/>".
"1) 현재 사용중인 요금제 : {{prev_student_count}}명 ({{prev_price}}원)<br/>".
"2) 신청하신 업그레이드 요금제 : {{upgrade_student_count}}명 ({{upgrade_price}}원)<br/>".
"<br/>".
"<br/>".
"계정 요금제 업그레이드를 위한 은행 계좌 입금 정보는 아래와 같습니다.<br/>".
"------------------------------------------------------------<br/>".
"* 은행 계좌 : {{bank_account_no}} ( 카카오뱅크, 예금주 : 박지상 )<br/>".
"* 금액 : {{price}}원<br/>".
"* 금액 : {{price}}원<br/>".
"* 송금자명 : {{maestro_name}} (신청하신 마에스트로 아이디)<br/>".
" ☞ 빠른 입금 확인을 위해, 송금자명을 본인 이름 대신 위와 같이 아이디로 부탁드립니다 ☜<br/>".
"------------------------------------------------------------<br/>".
@@ -180,7 +180,7 @@ $subjectMap['upgradeDone'] = "[초코마에] {{maestro_name}} - 마에스트로
$bodyMap['upgradeDone'] = "안녕하세요.<br/>".
"[초코마에] 마에스트로 계정 요금제 업그레이드를 신청해주셔서 감사합니다.<br/>".
"<br/>".
"{{maestro_name}} - 마에스트로 계정의 요금제가 [ 50명 (2만원) ] 에서 [ 500명 (4만원) ] 로 업그레이드 되었습니다.<br/>".
"{{maestro_name}} - 마에스트로 계정의 요금제가 [ 50명 ({{prev_price}}원) ] 에서 [ 500명 ({{price}}원) ] 로 업그레이드 되었습니다.<br/>".
"<br/>".
"* 마에스트로 계정 유효기간이 오늘부터 1년으로 다시 채워졌습니다.<br/>".
"<br/>".
+3 -9
View File
@@ -1,15 +1,13 @@
<?php
header("Content-Type: application/json");
include "./../setup/connect_db.php";
include "./../lib/send_reply_json.php";
include "./../lib/maestro_account_info.php";
include "./../setup/connect_db.php";
include "./../lib/db_maestro.php";
include "./mail_setting.php";
// include "./mail_setting.php";
// include "./send_mail.php";
include "./send_naver_mail.php";
/*
$type = $_POST["type"];
$maestro_id = $_POST["maestro_id"];
$maestro_name = $_POST["maestro_name"];
@@ -22,9 +20,7 @@ $upgrade_account_type = $_POST["upgrade_account_type"];
$registered_account_type = $_POST["registered_account_type"];
$maestro_name_prev = $_POST["maestro_name_prev"];
$maestro_email_prev = $_POST["email_prev"];
*/
/*
if($type == "sendMailRegisterBankInfo") {
$result = sendMailRegisterBankInfo($maestro_name, $maestro_email, $account_type);
} else if($type == "sendMailRegistered") {
@@ -46,10 +42,8 @@ if($type == "sendMailRegisterBankInfo") {
$maestro_data = get_maestro_data($maestro_id);
set_data("maestroData", $maestro_data);
}
*/
$return = true;
set_data("sendMailResult", $return);
set_data("sendMailResult", $result);
send_result_success();
exit;
+37 -29
View File
@@ -1,49 +1,45 @@
<?php
header("Content-Type: application/json");
error_reporting( E_ALL );
ini_set( "display_errors", 1 );
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require './../PHPMailer/src/Exception.php';
require './../PHPMailer/src/PHPMailer.php';
require './../PHPMailer/src/SMTP.php';
require './mail_contents.php';
require './../lib/maestro_account_info.php';
include './mail_setting.php';
include './mail_contents.php';
include './../lib/maestro_account_info.php';
// include_once "./../lib/send_reply_json.php";
// Register
function sendMailRegisterBankInfo($maestro_name, $maestro_email, $account_type) {
global $subjectMap, $bodyMap;
// closed beta
/*
$subject = str_replace("{{maestro_name}}", $maestro_name, $subjectMap['closedBetaRegistrationBankInfo']);
$body = str_replace("{{maestro_name}}", $maestro_name, $bodyMap['closedBetaRegistrationBankInfo']);
$body = str_replace("{{student_count}}", get_max_player_count($account_type), $body);
$body = str_replace("{{price}}", get_price($account_type), $body);
*/
$price = number_format(get_price($account_type));
$body = str_replace("{{price}}", $price, $body);
$subject = "Naver 메일 발신 테스트";
$body = "sendMailRegisterBankInfo";
send_naver_mail($maestro_email, $maestro_name, $subject, $body);
return send_naver_mail($maestro_email, $maestro_name, $subject, $body);
}
function sendMailRegisterDone($maestro_name, $maestro_email) {
global $subjectMap, $bodyMap;
// closed beta
/*
$subject = str_replace("{{maestro_name}}", $maestro_name, $subjectMap['closedBetaRegistrationDone']);
$body = str_replace("{{maestro_name}}", $maestro_name, $bodyMap['closedBetaRegistrationDone']);
*/
$subject = "Naver 메일 발신 테스트";
$body = "sendMailRegisterDone";
send_naver_mail($maestro_email, $maestro_name, $subject, $body);
return send_naver_mail($maestro_email, $maestro_name, $subject, $body);
}
@@ -52,14 +48,14 @@ function sendMailExtensionBankInfo($maestro_name, $available_date, $new_availabl
$subject = "Naver 메일 발신 테스트";
$body = "sendMailExtensionBankInfo";
send_naver_mail($maestro_email, $maestro_name, $subject, $body);
return send_naver_mail($maestro_email, $maestro_name, $subject, $body);
}
function sendMailExtensionDone($maestro_name, $new_available_date, $maestro_email) {
$subject = "Naver 메일 발신 테스트";
$body = "sendMailExtensionDone";
send_naver_mail($maestro_email, $maestro_name, $subject, $body);
return send_naver_mail($maestro_email, $maestro_name, $subject, $body);
}
@@ -68,30 +64,38 @@ function sendMailUpgradeBankInfo($maestro_name, $maestro_email, $account_type, $
$subject = "Naver 메일 발신 테스트";
$body = "sendMailUpgradeBankInfo";
send_naver_mail($maestro_email, $maestro_name, $subject, $body);
return send_naver_mail($maestro_email, $maestro_name, $subject, $body);
}
function sendMailUpgradeDone($maestro_name, $maestro_email, $account_type, $upgrade_account_type) {
$subject = "Naver 메일 발신 테스트";
$body = "sendMailUpgradeDone";
send_naver_mail($maestro_email, $maestro_name, $subject, $body);
return send_naver_mail($maestro_email, $maestro_name, $subject, $body);
}
// Update
function sendMailUpdateMaestroName($maestro_name, $maestro_name_prev, $maestro_email) {
$subject = "Naver 메일 발신 테스트";
$body = "sendMailUpdateMaestroName";
global $subjectMap, $bodyMap;
send_naver_mail($maestro_email, $maestro_name, $subject, $body);
$subject = str_replace("{{update_maestro_name}}", $maestro_name, $subjectMap['updateMaestroName']);
$body = str_replace("{{prev_maestro_name}}", $maestro_name_prev, $bodyMap['updateMaestroName']);
$body = str_replace("{{update_maestro_name}}", $maestro_name, $body);
return send_naver_mail($maestro_email, $maestro_name, $subject, $body);
}
function sendMailUpdateMaestroEmail($maestro_name, $maestro_email, $maestro_email_prev) {
$subject = "Naver 메일 발신 테스트";
$body = "sendMailUpdateMaestroEmail";
global $subjectMap, $bodyMap;
send_naver_mail($maestro_email, $maestro_name, $subject, $body);
$subject = $subjectMap['updateMaestroEmail'];
$body = str_replace("{{prev_email}}", $maestro_email_prev, $bodyMap['updateMaestroEmail']);
$body = str_replace("{{update_email}}", $maestro_email, $body);
return send_naver_mail($maestro_email, $maestro_name, $subject, $body);
}
// experation
@@ -99,10 +103,9 @@ function sendMailExperation30days($maestro_name, $maestro_email, $maestro_email_
$subject = "Naver 메일 발신 테스트";
$body = "sendMailExperation30days";
send_naver_mail($maestro_email, $maestro_name, $subject, $body);
return send_naver_mail($maestro_email, $maestro_name, $subject, $body);
}
// Load Composer's autoloader
// require $_SERVER['DOCUMENT_ROOT'] . '/vendor/autoload.php';
@@ -148,10 +151,15 @@ function send_naver_mail($maestro_email, $maestro_name, $subject, $body) {
$mail->Body = $body;
$mail->send();
echo 'Message has been sent';
// set_data("message", "Message has been sent");
// send_result_success();
return true;
} catch (Exception $e) {
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
// set_error_code("Message could not be sent. Mailer Error: {".$mail->ErrorInfo."}");
// send_result_success();
return false;
}
}