getSender() публичный Метод

This has a higher significance than the From address.
public getSender ( ) : string
Результат string
Пример #1
0
 public function send(Swift_Mime_Message $message, &$failedRecipients = null)
 {
     $failedRecipients = (array) $failedRecipients;
     $msg = '* ' . $message->getSubject() . ' *' . PHP_EOL . PHP_EOL;
     if ($message instanceof CM_Mail_Message) {
         $msg .= $message->getText() . PHP_EOL;
     } else {
         $msg .= $message->getBody() . PHP_EOL;
     }
     $logger = $this->getLogger();
     $context = new CM_Log_Context();
     $context->setExtra(['type' => CM_Paging_Log_Mail::getTypeStatic(), 'sender' => $message->getSender(), 'replyTo' => $message->getReplyTo(), 'to' => $message->getTo(), 'cc' => $message->getCc(), 'bcc' => $message->getBcc()]);
     $logger->addMessage($msg, $this->_logLevel, $context);
     return count($message->getTo()) + count($message->getCc()) + count($message->getBcc());
 }
Пример #2
0
 /** Determine the best-use reverse path for this message */
 private function getReversePath(Swift_Mime_Message $message)
 {
     $return = $message->getReturnPath();
     $sender = $message->getSender();
     $from = $message->getFrom();
     $path = null;
     if (!empty($return)) {
         $path = $return;
     } elseif (!empty($sender)) {
         $keys = array_keys($sender);
         $path = array_shift($keys);
     } elseif (!empty($from)) {
         $keys = array_keys($from);
         $path = array_shift($keys);
     }
     return $path;
 }
 /** Determine the best-use reverse path for this message */
 protected function getReversePath(Swift_Mime_Message $message)
 {
     $return = $message->getReturnPath();
     $sender = $message->getSender();
     $from = $message->getFrom();
     $path = null;
     if (!empty($return)) {
         $path = $return;
     } elseif (!empty($sender)) {
         // Don't use array_keys
         reset($sender);
         // Reset Pointer to first pos
         $path = key($sender);
         // Get key
     } elseif (!empty($from)) {
         reset($from);
         // Reset Pointer to first pos
         $path = key($from);
         // Get key
     }
     return $path;
 }