Add: send mail batch php - 7days left, overdated
This commit is contained in:
@@ -4,40 +4,42 @@
|
||||
|
||||
include "./../../web/server/setup/connect_db.php";
|
||||
|
||||
include "./../../web/php/mail/mail_sender.php";
|
||||
//include "./../../web/php/mail/chocomae_info.php";
|
||||
include "./../../web/php/mail/mail_setting.php";
|
||||
include "./../../web/php/mail/chocomae_info.php";
|
||||
include './../../web/server/mail/mail_contents.php';
|
||||
include './../../web/server/lib/maestro_account_info.php';
|
||||
include "./../../web/server/mail/send_naver_mail.php";
|
||||
|
||||
$maestroList = null;
|
||||
$maestroList = get_maestro_list();
|
||||
print_r($maestroList);
|
||||
$maestroList = get_7days_left_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_maestro_list(): array
|
||||
function get_7days_left_maestro_list(): array
|
||||
{
|
||||
global $db_conn;
|
||||
|
||||
/*
|
||||
$query = "
|
||||
select MaestroID, Name, AccountType, ActivateStatus, AvailableActivateDateTime, AcceptClausesDateTime, PlayerCount
|
||||
select MaestroID, Name, Email, AccountType, ActivateStatus, AvailableActivateDateTime, AcceptClausesDateTime, PlayerCount
|
||||
from maestro
|
||||
where DATE(AvailableActivateDateTime) - INTERVAL 7 DAY = DATE(NOW()) AND ActivateStatus = 1
|
||||
";
|
||||
*/
|
||||
$query = "
|
||||
select MaestroID, Name, AccountType, ActivateStatus, AvailableActivateDateTime, AcceptClausesDateTime, PlayerCount
|
||||
from maestro
|
||||
where DATE(AvailableActivateDateTime) - INTERVAL 70 DAY < DATE(NOW()) AND ActivateStatus = 1
|
||||
";
|
||||
$stmt = $db_conn->prepare($query);
|
||||
$stmt->execute();
|
||||
$stmt->bind_result($maestroID, $name, $accountType, $activateStatus, $availableActivateDateTime , $acceptClausesDateTime, $playerCount);
|
||||
$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;
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
# /Applications/MAMP/bin/php/php7.3.1/bin/php send_mail_to_overdated_maestro.php
|
||||
|
||||
include "./../../web/server/setup/connect_db.php";
|
||||
|
||||
//include "./../../web/php/mail/chocomae_info.php";
|
||||
include "./../../web/php/mail/mail_setting.php";
|
||||
include './../../web/server/mail/mail_contents.php';
|
||||
include './../../web/server/lib/maestro_account_info.php';
|
||||
include "./../../web/server/mail/send_naver_mail.php";
|
||||
|
||||
$maestroList = null;
|
||||
$maestroList = get_overdated_maestro_list();
|
||||
//print_r($maestroList);
|
||||
|
||||
foreach ($maestroList as $maestro) {
|
||||
$result = sendMailToOverDatedMestroEmail($maestro["maestroName"], $maestro["email"], $maestro["availableActivateDateTime"]);
|
||||
// printf("result : %s\n", $result);
|
||||
}
|
||||
|
||||
exit;
|
||||
|
||||
|
||||
function get_overdated_maestro_list(): array
|
||||
{
|
||||
global $db_conn;
|
||||
|
||||
$query = "
|
||||
select MaestroID, Name, Email, AccountType, ActivateStatus, AvailableActivateDateTime, AcceptClausesDateTime, PlayerCount
|
||||
from maestro
|
||||
where DATE(AvailableActivateDateTime) + INTERVAL 1 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;
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
# /Applications/MAMP/bin/php/php7.3.1/bin/php send_mail_to_7days_left_maestro.php
|
||||
|
||||
include "./../../web/server/setup/connect_db.php";
|
||||
|
||||
//include "./../../web/php/mail/chocomae_info.php";
|
||||
include "./../../web/php/mail/mail_setting.php";
|
||||
include './../../web/server/mail/mail_contents.php';
|
||||
include './../../web/server/lib/maestro_account_info.php';
|
||||
include "./../../web/server/mail/send_naver_mail.php";
|
||||
|
||||
$maestroList = null;
|
||||
$maestroList = get_7days_left_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;
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
# /Applications/MAMP/bin/php/php7.3.1/bin/php send_mail_to_overdated_maestro.php
|
||||
|
||||
include "./../../web/server/setup/connect_db.php";
|
||||
|
||||
//include "./../../web/php/mail/chocomae_info.php";
|
||||
include "./../../web/php/mail/mail_setting.php";
|
||||
include './../../web/server/mail/mail_contents.php';
|
||||
include './../../web/server/lib/maestro_account_info.php';
|
||||
include "./../../web/server/mail/send_naver_mail.php";
|
||||
|
||||
$maestroList = null;
|
||||
$maestroList = get_overdated_maestro_list();
|
||||
print_r($maestroList);
|
||||
|
||||
//foreach ($maestroList as $maestro) {
|
||||
// $result = sendMailToOverDatedMestroEmail($maestro["maestroName"], $maestro["email"], $maestro["availableActivateDateTime"]);
|
||||
// printf("result : %s\n", $result);
|
||||
//}
|
||||
|
||||
exit;
|
||||
|
||||
|
||||
function get_overdated_maestro_list(): array
|
||||
{
|
||||
global $db_conn;
|
||||
|
||||
$query = "
|
||||
select MaestroID, Name, Email, AccountType, ActivateStatus, AvailableActivateDateTime, AcceptClausesDateTime, PlayerCount
|
||||
from maestro
|
||||
where DATE(AvailableActivateDateTime) + INTERVAL 1 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;
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user