Ejemplo n.º 1
0
 public function action_submit()
 {
     if (!Security::check_token()) {
         Response::redirect('_404_');
     }
     if (Session::get_flash('name')) {
         $contact = Model_Contact::forge();
         $contact->title = Session::get_flash("title");
         $contact->body = Session::get_flash("body");
         $body = View::forge("email/contact");
         $body->set("name", Session::get_flash('name'));
         $body->set("email", Session::get_flash('email'));
         $body->set("body", Session::get_flash('body'));
         $sendmail = Email::forge("JIS");
         $sendmail->from(Config::get("statics.info_email"), Config::get("statics.info_name"));
         $sendmail->to(Config::get("statics.info_email"));
         $sendmail->subject("We got contact/ Game-bootcamp");
         $sendmail->body($body);
         $sendmail->send();
     }
     $this->template->title = "Contact";
     $this->template->sub = "How can we help you?";
     $view = View::forge("contacts/send");
     $this->template->content = $view;
 }
Ejemplo n.º 2
0
 /**
  * Creates a new contact.
  *
  * @param array $data Contact data.
  *
  * @return Model_Contact
  */
 public static function create(array $data)
 {
     $contact = Model_Contact::forge();
     $contact->populate($data);
     try {
         $contact->save();
     } catch (FuelException $e) {
         Log::error($e);
         return false;
     }
     return $contact;
 }
Ejemplo n.º 3
0
 public function action_submit()
 {
     if (!Security::check_token()) {
         Response::redirect('_404_');
     }
     if (Session::get_flash('title')) {
         $contact = Model_Contact::forge();
         $contact->title = Session::get_flash("title");
         $contact->body = Session::get_flash("body");
         $contact->user_id = $this->user->id;
         $contact->save();
     } else {
         Response::redirect('_404_');
     }
     $this->template->content = View::forge('teachers/contact/finish');
 }
 /**
  * contacts テーブルへの登録
  *
  * @access private
  * @return Model_Contactオブジェクト
  */
 private function registerContact()
 {
     $data = $this->getContactData();
     if (!$data) {
         throw new Exception(\Model_Error::ER00603);
     } else {
         $contact = Model_Contact::forge();
         $contact->set($data);
         $contact->save(NULL, true);
         return $contact;
     }
 }
Ejemplo n.º 5
0
 public function save($data)
 {
     unset($data['to'], $data['to_name']);
     $contact = Model_Contact::forge($data);
     if (!$contact->save()) {
         throw new EmailSavingFailedException('One or more email did not saved ' . $item);
     }
 }