3 UserCake Version: 2.0.2
\r
8 //UserCake uses a text based system with hooks to replace various strs in txt email templates
\r
9 public $contents = NULL;
\r
11 //Function used for replacing hooks in our templates
\r
12 public function newTemplateMsg($template,$additionalHooks)
\r
14 global $mail_templates_dir,$debug_mode;
\r
16 $this->contents = file_get_contents($mail_templates_dir.$template);
\r
18 //Check to see we can access the file / it has some contents
\r
19 if(!$this->contents || empty($this->contents))
\r
25 //Replace default hooks
\r
26 $this->contents = replaceDefaultHook($this->contents);
\r
28 //Replace defined / custom hooks
\r
29 $this->contents = str_replace($additionalHooks["searchStrs"],$additionalHooks["subjectStrs"],$this->contents);
\r
35 public function sendMail($email,$subject,$msg = NULL)
\r
37 global $websiteName,$emailAddress;
\r
39 $header = "MIME-Version: 1.0\r\n";
\r
40 $header .= "Content-type: text/plain; charset=iso-8859-1\r\n";
\r
41 $header .= "From: ". $websiteName . " <" . $emailAddress . ">\r\n";
\r
43 //Check to see if we sending a template email.
\r
45 $msg = $this->contents;
\r
49 $message = wordwrap($message, 70);
\r
51 return mail($email,$subject,$message,$header);
\r