Exemplo n.º 1
0
 /**
  * init site_mail
  */
 public function init($type = 0)
 {
     $query_struct = array();
     $query_struct['where']['type'] = $type;
     $mail_categories = Mymail_category::instance()->mail_categories();
     foreach ($mail_categories as $key => $value) {
         $mail_template = Mymail_template::get_default_by_category($value['id']);
         $data = $mail_template;
         $this->set($data);
     }
 }
Exemplo n.º 2
0
 /**
  * delete mail template
  */
 public function delete($id)
 {
     if (Mymail_template::instance($id)->delete()) {
         remind::set(Kohana::lang('o_global.delete_success'), 'manage/mail_template', 'success');
     } else {
         $error = Mymail_template::instance($id)->error();
         remind::set(Kohana::lang('o_global.delete_error') . $error, 'manage/mail_template');
     }
 }
Exemplo n.º 3
0
 /**
  * pervice a mail
  */
 function perview($type, $id)
 {
     //非法请求
     if (!request::referrer()) {
         remind::set(Kohana::lang('o_global.bad_request'), 'site/mail', 'error');
     }
     if ($type == 'site') {
         $mail = Mymail::instance($id)->get();
     } else {
         $mail = Mymail_template::instance($id)->get();
     }
     $this->template = new View('template_blank');
     $this->template->content = $mail['content'];
 }