/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
  2. class Message
  3. {
  4. var $gui;
  5. function message($gui = NULL)
  6. {
  7. if($gui)
  8. $this->gui = $gui;
  9. else
  10. $this->gui = new gui();
  11. }
  12. function setLanguageId($languageId)
  13. {
  14. $this->gui->setLanguageId($languageId);
  15. }
  16. function assign($key, $value)
  17. {
  18. $this->gui->assign($key, $value);
  19. }
  20. function getTranslation($tpl_file, $name)
  21. {
  22. return $this->gui->getTranslation($tpl_file, $name);
  23. }
  24. function sendText($template, $to, $toName, $from, $fromName, $subject)
  25. {
  26. $body = $this->gui->fetch($template);
  27. mail::text($to, $toName, $from, $fromName, $subject, $body);
  28. }
  29. function sendHtml($template, $to, $toName, $from, $fromName, $subject)
  30. {
  31. $body = $this->gui->fetch($template);
  32. mail::html($to, $toName, $from, $fromName, $subject, $body);
  33. }
  34. }