예제 #1
0
 public function setup() {
   parent::setup();
   $GLOBALS['obm']['uid'] = 3;
   $this->mailObserver = new OBM_EventMailObserver();
   OBM_EventFactory::getInstance()->attach($this->mailObserver);
   SMailer::set_default_transport(new Stato_StaticTransport());
   OBM_Acl::initialize();
 }
예제 #2
0
 /**
  * Method used to create a mail (called by prepare)
  * @param string $method_name
  * @param array  $args
  * @access public
  * @return void
  */
 public function create($method_name, $args)
 {
     $mail = parent::create($method_name, $args);
     if (!is_array($this->cc)) {
         $this->cc = array($this->cc);
     }
     foreach ($this->cc as $cc) {
         if (is_array($cc)) {
             $mail->add_cc($cc[0], $cc[1]);
         } else {
             $mail->add_cc($cc);
         }
     }
     if (!is_array($this->bcc)) {
         $this->bcc = array($this->bcc);
     }
     foreach ($this->bcc as $bcc) {
         if (is_array($bcc)) {
             $mail->add_bcc($bcc[0], $bcc[1]);
         } else {
             $mail->add_bcc($bcc);
         }
     }
     if (!is_array($this->images)) {
         $this->images = array();
     }
     if (isset($this->images['filename'])) {
         $this->images = array($this->images);
     }
     foreach ($this->images as $a) {
         if (!is_array($a)) {
             $a = array();
         }
         $a = array_merge(self::$image_defaults, $a);
         $mail->add_embedded_image($a['content'], $a['content_id'], $a['filename'], $a['content_type'], $a['encoding']);
     }
     return $mail;
 }
예제 #3
0
파일: MailerTest.php 프로젝트: Kervinou/OBM
 public function test_render_body_when_template_root_not_set_should_throw()
 {
     $this->setExpectedException('SMailException', 'Template root not set');
     SMailer::set_template_root(null);
     $mail = $this->mailer->prepare_greetings_message($this->user);
 }
예제 #4
0
파일: of_mailer.php 프로젝트: Kervinou/OBM
 public function prepare($method_name, $args) {
   $mail = parent::prepare($method_name, $args);
   $mail->set_return_path($this->return_path);
   return $mail;
 }
예제 #5
0
파일: mailer.php 프로젝트: Kervinou/OBM
 public static function set_default_transport(SIMailTransport $transport)
 {
     self::$transport = $transport;
 }