/** * Load message template * @param string $template template code */ public function template($template, $data = null) { $tpl = fx::content('mail_template')->where('keyword', $template)->one(); if ($tpl) { $this->mail_template = $tpl; } if (!is_null($data)) { $this->data($data); } return $this; }