public function due_date($deliverable) { $variables_array = $this->variables; if (isset($variables_array["DELIVERABLE_" . Sow::variablize($deliverable->best_title()) . "_DUE"])) { return $variables_array["DELIVERABLE_" . Sow::variablize($deliverable->best_title()) . "_DUE"]; } else { return date('n/j/y'); } }
public static function send($template_name, $vars) { $transport = Config::get('mailer.transport'); $mailer = Swift_Mailer::newInstance($transport); $message = Swift_Message::newInstance(); $message->setFrom(array('*****@*****.**' => 'SOW Composer')); if ($template_name == "SOW_COMPLETED") { $sow = Sow::find($vars["sow_id"]); $attachment = Swift_Attachment::newInstance()->setFilename($sow->title . '.doc')->setContentType('application/msword')->setBody(View::make('partials.doc')->with('sow', $sow)); $message->setSubject("Here's your completed SOW, \"{$sow->title}\"")->setTo(array($sow->author_email))->addPart(View::make('mailer.sow_completed_text')->with('sow', $sow), 'text/plain')->setBody(View::make('mailer.sow_completed_html')->with('sow', $sow), 'text/html')->attach($attachment); } else { throw new Exception("Couldn't find the SowMailer template that you requested."); } $mailer->send($message); }
public function action_view($read_only_uuid) { $view = View::make('home.view'); $view->sow = Sow::where('read_only_uuid', '=', $read_only_uuid)->first(); $this->layout->content = $view; }