58392f82c9
* jinaju.com SPF 설정 작업이 선행됨
54 lines
1.8 KiB
PHP
54 lines
1.8 KiB
PHP
<?php
|
|
|
|
# /Applications/MAMP/bin/php/php7.3.1/bin/php send_mail_to_7days_left_maestro.php
|
|
|
|
include __DIR__."/../../web/server/setup/connect_db.php";
|
|
|
|
//include __DIR__."/../../web/php/mail/chocomae_info.php";
|
|
include __DIR__."/../../web/php/mail/mail_setting.php";
|
|
include __DIR__."/../../web/server/mail/mail_contents.php";
|
|
include __DIR__."/../../web/server/lib/maestro_account_info.php";
|
|
include __DIR__."/../../web/server/mail/send_jinaju_mail.php";
|
|
|
|
$maestroList = null;
|
|
$maestroList = get_closed_beta_paid_maestro_list();
|
|
//print_r($maestroList);
|
|
|
|
foreach ($maestroList as $maestro) {
|
|
$result = sendMailTo7DaysLeftMestroEmail($maestro["maestroName"], $maestro["email"], $maestro["availableActivateDateTime"]);
|
|
// printf("result : %s\n", $result);
|
|
}
|
|
|
|
exit;
|
|
|
|
|
|
function get_7days_left_maestro_list(): array
|
|
{
|
|
global $db_conn;
|
|
|
|
$query = "
|
|
select MaestroID, Name, Email, AccountType, ActivateStatus, AvailableActivateDateTime, AcceptClausesDateTime, PlayerCount
|
|
from maestro
|
|
where DATE(AvailableActivateDateTime) - INTERVAL 7 DAY = DATE(NOW()) AND ActivateStatus = 1
|
|
";
|
|
$stmt = $db_conn->prepare($query);
|
|
$stmt->execute();
|
|
$stmt->bind_result($maestroID, $name, $email, $accountType, $activateStatus, $availableActivateDateTime , $acceptClausesDateTime, $playerCount);
|
|
|
|
$maestroList = array();
|
|
while($stmt->fetch()) {
|
|
$maestro["maestroID"] = $maestroID;
|
|
$maestro["maestroName"] = $name;
|
|
$maestro["email"] = $email;
|
|
$maestro["accountType"] = $accountType;
|
|
$maestro["activateStatus"] = $activateStatus;
|
|
$maestro["availableActivateDateTime"] = $availableActivateDateTime;
|
|
$maestro["acceptClausesDateTime"] = $acceptClausesDateTime;
|
|
$maestro["playerCount"] = $playerCount;
|
|
array_push($maestroList, $maestro);
|
|
}
|
|
|
|
return $maestroList;
|
|
}
|
|
|
|
?>
|