public function send_notif(\System\Http\Response $res) { $ren = \System\Template\Renderer\Txt::from_response($res); $ren->reset_layout(); $ren->partial('mail/car/offer', array("admin" => $res->url_full('carshare.admin', array($this->ident)))); $mail = new \Helper\Offcom\Mail(array('rcpt' => array($this->email), 'subject' => 'Improtřesk 2016 - Sdílení auta', 'reply_to' => \System\Settings::get('offcom', 'default', 'reply_to'), 'message' => $ren->render_content())); $mail->send(); $this->sent_notif = true; $this->save(); }
public function send_notif_author(\System\Http\Response $res) { if ($this->status == self::STATUS_APPROVED) { $partial = 'mail/car/approved'; } else { if ($this->status == self::STATUS_DENIED) { $partial = 'mail/car/denied'; } else { if ($this->status == self::STATUS_CANCELED) { $partial = 'mail/car/canceled'; } else { return $this; } } } $ren = \System\Template\Renderer\Txt::from_response($res); $ren->reset_layout(); $ren->partial($partial, array("item" => $this, "offer" => $this->car, "full" => $this->car->is_full(), "admin" => $res->url_full('carshare.admin', array($this->car->ident)))); $mail = new \Helper\Offcom\Mail(array('rcpt' => array($this->email), 'reply_to' => $this->car->email, 'subject' => 'Improtřesk 2016 - Odpověď od řidiče', 'message' => $ren->render_content())); $mail->send(); $this->sent_notif = true; $this->save(); }
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(); }); }