public function mail_payment_update() { $check = $this->check; if (!$check) { return; } $payments = $check->payments->fetch(); $paid = 0; foreach ($payments as $p) { $paid += $p->amount; } $ren = new \System\Template\Renderer\Txt(); $ren->reset_layout(); $ren->partial('mail/signup/payment-update', array("item" => $this, "check" => $check, "paid" => $paid, "payments" => $payments)); $mail = new \Helper\Offcom\Mail(array('rcpt' => array($this->email), 'subject' => 'Improtřesk 2016 - Přihláška, platební aktualizace', 'reply_to' => \System\Settings::getSafe(array('offcom', 'default', 'reply_to'), null), 'message' => $ren->render_content())); $mail->send(); $this->sent_notif = true; $this->save(); }
public function cmd_lostAndFound() { \System\Init::full(); $users = \Workshop\SignUp::get_all()->where(array("solved" => true, "newsletter" => true, "sentLostAndFound" => false))->fetch(); \Helper\Cli::do_over($users, function ($key, $user) { $ren = new \System\Template\Renderer\Txt(); $ren->reset_layout(); $ren->partial('mail/notif/lost-and-found', array("user" => $user, "symvar" => $user->check->symvar)); $mail = new \Helper\Offcom\Mail(array('rcpt' => array($user->email), 'subject' => 'Improtřesk 2016 - Ztráty a nálezy, pozvánka', 'reply_to' => \System\Settings::get('offcom', 'default', 'reply_to'), 'message' => $ren->render_content())); $mail->send(); $user->sentLostAndFound = true; $user->save(); }); }