PageRenderTime 21ms CodeModel.GetById 13ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/framework/experimental/mail/Message.php

http://zoop.googlecode.com/
PHP | 42 lines | 34 code | 8 blank | 0 comment | 1 complexity | 1a2b9647622abb40f2719d88f51b4849 MD5 | raw file
 1<?php
 2class Message
 3{
 4	var $gui;
 5	
 6	function message($gui = NULL)
 7	{
 8		if($gui)
 9			$this->gui = $gui;
10		else
11			$this->gui = new gui();		
12	}
13	
14	function setLanguageId($languageId)
15	{
16		$this->gui->setLanguageId($languageId);
17	}
18	
19	function assign($key, $value)
20	{
21		$this->gui->assign($key, $value);
22	}
23	
24	function getTranslation($tpl_file, $name)
25	{
26		return $this->gui->getTranslation($tpl_file, $name);
27	}
28	
29	function sendText($template, $to, $toName, $from, $fromName, $subject)
30	{
31		$body = $this->gui->fetch($template);
32		
33		mail::text($to, $toName, $from, $fromName, $subject, $body);
34	}
35	
36	function sendHtml($template, $to, $toName, $from, $fromName, $subject)
37	{
38		$body = $this->gui->fetch($template);
39		
40		mail::html($to, $toName, $from, $fromName, $subject, $body);
41	}
42}