diff --git a/webapp/controller/GMController.class.php b/webapp/controller/GMController.class.php index 86e1cac8..57768964 100644 --- a/webapp/controller/GMController.class.php +++ b/webapp/controller/GMController.class.php @@ -8,6 +8,7 @@ require_once('mt/LootConfig.php'); require_once('services/AwardService.php'); require_once('services/PropertyChgService.php'); require_once('services/LootService.php'); +require_once('services/MailApiService.php'); require_once('models/Nft.php'); use phpcommon\SqlHelper; @@ -268,4 +269,41 @@ END } } + public function sendMail() + { + $to = getReqVal('to', ''); + $subject = getReqVal('subject', ''); + $content = getReqVal('content', ''); + $attachments = getReqVal('attachments', ''); + $unikey = 'test:' . uniqid(); + SqlHelper::upsert + (myself()->_getMailMysql(), + 't_sys_mail', + array( + 'unikey' => $unikey + ), + array( + ), + array( + 'unikey' => $unikey, + 'subject' => $subject, + 'content' => $content, + 'recipients' => json_encode(array( + array( + 'account_id' => $to, + ) + )), + 'attachments' => $attachments, + 'tag1' => 1, + 'tag2' => 100, + 'sendtime' => myself()->_getNowTime(), + 'expiretime' => myself()->_getNowTime() + 3600 * 24 * 365 * 10, + 'user_reg_start_time' => 0, + 'user_reg_end_time' => myself()->_getNowTime() + 3600 * 24 * 365 * 10, + 'createtime' => myself()->_getNowTime(), + 'modifytime' => myself()->_getNowTime() + ) + ); + } + }