From da75a2e409c1bb86d62a305757bf0392a76e3d03 Mon Sep 17 00:00:00 2001 From: shimon Date: Tue, 30 May 2023 18:13:30 +0300 Subject: [PATCH] calc tier stats --- src/Appwrite/Platform/Tasks/CalcTierStats.php | 62 +++++++++---------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/src/Appwrite/Platform/Tasks/CalcTierStats.php b/src/Appwrite/Platform/Tasks/CalcTierStats.php index 82d3e02007..1e6ec0718f 100644 --- a/src/Appwrite/Platform/Tasks/CalcTierStats.php +++ b/src/Appwrite/Platform/Tasks/CalcTierStats.php @@ -257,36 +257,36 @@ class CalcTierStats extends Action $pools ->get('console') ->reclaim(); -// -// /** @var PHPMailer $mail */ -// $mail = $register->get('smtp'); -// -// $mail->clearAddresses(); -// $mail->clearAllRecipients(); -// $mail->clearReplyTos(); -// $mail->clearAttachments(); -// $mail->clearBCCs(); -// $mail->clearCCs(); -// -// try { -// /** Addresses */ -// $mail->setFrom(App::getEnv('_APP_SYSTEM_EMAIL_ADDRESS', APP_EMAIL_TEAM), 'Appwrite Cloud Hamster'); -// $recipients = explode(',', App::getEnv('_APP_USERS_STATS_RECIPIENTS', '')); -// -// foreach ($recipients as $recipient) { -// $mail->addAddress($recipient); -// } -// -// /** Attachments */ -// $mail->addAttachment($this->path); -// -// /** Content */ -// $mail->Subject = "Cloud Report for {$this->date}"; -// $mail->Body = "Please find the daily cloud report atttached"; -// $mail->send(); - // Console::success('Email has been sent!'); - // } catch (Exception $e) { - // Console::error("Message could not be sent. Mailer Error: {$mail->ErrorInfo}"); - // } + + /** @var PHPMailer $mail */ + $mail = $register->get('smtp'); + + $mail->clearAddresses(); + $mail->clearAllRecipients(); + $mail->clearReplyTos(); + $mail->clearAttachments(); + $mail->clearBCCs(); + $mail->clearCCs(); + + try { + /** Addresses */ + $mail->setFrom(App::getEnv('_APP_SYSTEM_EMAIL_ADDRESS', APP_EMAIL_TEAM), 'Appwrite Cloud Hamster'); + $recipients = explode(',', App::getEnv('_APP_USERS_STATS_RECIPIENTS', '')); + + foreach ($recipients as $recipient) { + $mail->addAddress($recipient); + } + + /** Attachments */ + $mail->addAttachment($this->path); + + /** Content */ + $mail->Subject = "Cloud Report for {$this->date}"; + $mail->Body = "Please find the daily cloud report atttached"; + $mail->send(); + Console::success('Email has been sent!'); + } catch (Exception $e) { + Console::error("Message could not be sent. Mailer Error: {$mail->ErrorInfo}"); + } } }