Browse Source

Reformat code te be PSR-2 compatible

tags/2.0.0-beta
SonicGD 11 years ago
parent
commit
3db18c198a
  1. 5
      Mailer.php
  2. 14
      Message.php

5
Mailer.php

@ -96,6 +96,7 @@ class Mailer extends BaseMailer
if (!is_object($this->_swiftMailer)) {
$this->_swiftMailer = $this->createSwiftMailer();
}
return $this->_swiftMailer;
}
@ -119,6 +120,7 @@ class Mailer extends BaseMailer
if (!is_object($this->_transport)) {
$this->_transport = $this->createTransport($this->_transport);
}
return $this->_transport;
}
@ -132,6 +134,7 @@ class Mailer extends BaseMailer
$address = implode(', ', array_keys($address));
}
Yii::info('Sending email "' . $message->getSubject() . '" to "' . $address . '"', __METHOD__);
return $this->getSwiftMailer()->send($message->getSwiftMessage()) > 0;
}
@ -169,6 +172,7 @@ class Mailer extends BaseMailer
$transport->registerPlugin($plugin);
}
}
return $transport;
}
@ -215,6 +219,7 @@ class Mailer extends BaseMailer
}
}
}
return $object;
}
}

14
Message.php

@ -37,6 +37,7 @@ class Message extends BaseMessage
if (!is_object($this->_swiftMessage)) {
$this->_swiftMessage = $this->createSwiftMessage();
}
return $this->_swiftMessage;
}
@ -54,6 +55,7 @@ class Message extends BaseMessage
public function setCharset($charset)
{
$this->getSwiftMessage()->setCharset($charset);
return $this;
}
@ -71,6 +73,7 @@ class Message extends BaseMessage
public function setFrom($from)
{
$this->getSwiftMessage()->setFrom($from);
return $this;
}
@ -88,6 +91,7 @@ class Message extends BaseMessage
public function setReplyTo($replyTo)
{
$this->getSwiftMessage()->setReplyTo($replyTo);
return $this;
}
@ -105,6 +109,7 @@ class Message extends BaseMessage
public function setTo($to)
{
$this->getSwiftMessage()->setTo($to);
return $this;
}
@ -122,6 +127,7 @@ class Message extends BaseMessage
public function setCc($cc)
{
$this->getSwiftMessage()->setCc($cc);
return $this;
}
@ -139,6 +145,7 @@ class Message extends BaseMessage
public function setBcc($bcc)
{
$this->getSwiftMessage()->setBcc($bcc);
return $this;
}
@ -156,6 +163,7 @@ class Message extends BaseMessage
public function setSubject($subject)
{
$this->getSwiftMessage()->setSubject($subject);
return $this;
}
@ -165,6 +173,7 @@ class Message extends BaseMessage
public function setTextBody($text)
{
$this->setBody($text, 'text/plain');
return $this;
}
@ -174,6 +183,7 @@ class Message extends BaseMessage
public function setHtmlBody($html)
{
$this->setBody($html, 'text/html');
return $this;
}
@ -236,6 +246,7 @@ class Message extends BaseMessage
$attachment->setContentType($options['contentType']);
}
$this->getSwiftMessage()->attach($attachment);
return $this;
}
@ -252,6 +263,7 @@ class Message extends BaseMessage
$attachment->setContentType($options['contentType']);
}
$this->getSwiftMessage()->attach($attachment);
return $this;
}
@ -267,6 +279,7 @@ class Message extends BaseMessage
if (!empty($options['contentType'])) {
$embedFile->setContentType($options['contentType']);
}
return $this->getSwiftMessage()->embed($embedFile);
}
@ -282,6 +295,7 @@ class Message extends BaseMessage
if (!empty($options['contentType'])) {
$embedFile->setContentType($options['contentType']);
}
return $this->getSwiftMessage()->embed($embedFile);
}

Loading…
Cancel
Save