- $this->assign('html_version', $html);
- return $this->fetch($this->tpl);
+ static $plmail;
+ if (!isset($plmail) || $plmail->tpl != $tpl) {
+ $plmail = new PlMail($tpl);
+ }
+ $plmail->mailer =& $mailer;
+ return $plmail;
+ }
+
+ public function run($version)
+ {
+ $this->assign('mail_part', $version);
+ $text = $this->fetch($this->tpl);
+ if ($version == 'text') {
+ return wordwrap($text, 78);
+ }
+ return $text;