当前位置: 首页>>代码示例>>PHP>>正文


PHP Swift_Events_SendEvent::getMessage方法代码示例

本文整理汇总了PHP中Swift_Events_SendEvent::getMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP Swift_Events_SendEvent::getMessage方法的具体用法?PHP Swift_Events_SendEvent::getMessage怎么用?PHP Swift_Events_SendEvent::getMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Swift_Events_SendEvent的用法示例。


在下文中一共展示了Swift_Events_SendEvent::getMessage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: beforeSendPerformed

 /**
  * @param \Swift_Events_SendEvent $evt
  */
 public function beforeSendPerformed(\Swift_Events_SendEvent $evt)
 {
     $message = $evt->getMessage();
     $this->convert($message);
     $children = $message->getChildren();
     array_walk($children, array($this, 'convert'));
 }
开发者ID:Codixis,项目名称:CSBill,代码行数:10,代码来源:CssInlinerPlugin.php

示例2: beforeSendPerformed

  /**
   * Invoked immediately before the Message is sent.
   *
   * @param Swift_Events_SendEvent $evt
   */
  public function beforeSendPerformed(Swift_Events_SendEvent $evt)
  {
    $this->messages[] = $message = clone $evt->getMessage();

    $to = null === $message->getTo() ? '' : implode(', ', array_keys($message->getTo()));

    $this->dispatcher->notify(new sfEvent($this, 'application.log', array(sprintf('Sending email "%s" to "%s"', $message->getSubject(), $to))));
  }
开发者ID:nationalfield,项目名称:symfony,代码行数:13,代码来源:sfMailerMessageLoggerPlugin.class.php

示例3: sendPerformed

 public function sendPerformed(\Swift_Events_SendEvent $event)
 {
     // If this was sent through SES, retrieve the data
     if (config('mail.driver') == 'ses') {
         $message = $event->getMessage();
         $this->updateSesMessageId($message);
     }
 }
开发者ID:jdavidbakr,项目名称:mail-tracker,代码行数:8,代码来源:MailTracker.php

示例4: sendPerformed

 /**
  * Gestion des messages apres leur envoi
  * @param  Swift_Events_SendEvent  $event [description]
  * @return [type]        [description]
  */
 public function sendPerformed(\Swift_Events_SendEvent $evt)
 {
     if ($evt->getResult() === \Swift_Events_SendEvent::RESULT_SUCCESS && $this->enabled == true) {
         // Création de l'activity
         $activity = $this->createActivity($evt->getMessage());
         $this->dm->persist($activity);
         $this->dm->flush();
     }
 }
开发者ID:studiocaramia,项目名称:redking_MailBundle,代码行数:14,代码来源:SwiftEventListener.php

示例5: beforeSendPerformed

 /**
  * {@inheritdoc}
  */
 public function beforeSendPerformed(\Swift_Events_SendEvent $event)
 {
     $message = $event->getMessage();
     if (!$this->isEnabled() || !$message instanceof \Swift_Message || in_array($message->getId(), $this->performed)) {
         return;
     }
     $signature = new \Swift_Signers_DKIMSigner($this->getPrivateKey(), $this->domain, $this->selector);
     $message->attachSigner($signature);
     $this->performed[] = $message->getId();
 }
开发者ID:sonatra,项目名称:SonatraMailerBundle,代码行数:13,代码来源:DkimSignerPlugin.php

示例6: sendPerformed

 /**
  * Invoked immediately after the Message is sent.
  *
  * @param Swift_Events_SendEvent $evt
  */
 public function sendPerformed(Swift_Events_SendEvent $evt)
 {
     $message = $evt->getMessage();
     // restore original headers
     $headers = $message->getHeaders();
     if ($headers->has('X-Swift-Return-Path')) {
         $message->setReturnPath($headers->get('X-Swift-Return-Path')->getAddress());
         $headers->removeAll('X-Swift-Return-Path');
     }
 }
开发者ID:Ceciceciceci,项目名称:MySJSU-Class-Registration,代码行数:15,代码来源:ImpersonatePlugin.php

示例7: beforeSendPerformed

 /**
  * @param \Swift_Events_SendEvent $evt
  */
 public function beforeSendPerformed(\Swift_Events_SendEvent $evt)
 {
     $message = $evt->getMessage();
     if ($message->getContentType() === 'text/html' || $message->getContentType() === 'multipart/alternative' && $message->getBody() || $message->getContentType() === 'multipart/mixed' && $message->getBody()) {
         $message->setBody($this->converter->convert($message->getBody(), $this->css));
     }
     foreach ($message->getChildren() as $part) {
         if (strpos($part->getContentType(), 'text/html') === 0) {
             $part->setBody($this->converter->convert($part->getBody(), $this->css));
         }
     }
 }
开发者ID:fedeisas,项目名称:laravel-mail-css-inliner,代码行数:15,代码来源:CssInlinerPlugin.php

示例8: sendPerformed

 /**
  * Invoked immediately after the Message is sent.
  *
  * @param \Swift_Events_SendEvent $evt
  */
 public function sendPerformed(\Swift_Events_SendEvent $evt)
 {
     $result = $evt->getResult();
     $failed_recipients = $evt->getFailedRecipients();
     $message = $evt->getMessage();
     if ($result === \Swift_Events_SendEvent::RESULT_SUCCESS) {
         $level = $this->levels['sendPerformed.SUCCESS'];
     } else {
         $level = $this->levels['sendPerformed.NOT_SUCCESS'];
     }
     $this->log($level, 'MESSAGE (sendPerformed): ', array('result' => $result, 'failed_recipients' => $failed_recipients, 'message' => $message->toString()));
 }
开发者ID:gcrico,项目名称:swift-mailer-psr-logger-plugin,代码行数:17,代码来源:SwiftMailerPsrLoggerPlugin.php

示例9: beforeSendPerformed

 /**
  * Inline the CSS before an email is sent.
  *
  * @param \Swift_Events_SendEvent $evt
  */
 public function beforeSendPerformed(\Swift_Events_SendEvent $evt)
 {
     $message = $evt->getMessage();
     $properTypes = ['text/html', 'multipart/alternative', 'multipart/mixed'];
     if ($message->getBody() && in_array($message->getContentType(), $properTypes)) {
         $this->inliner->setHtml($message->getBody());
         $message->setBody($this->inliner->emogrify());
     }
     foreach ($message->getChildren() as $part) {
         if (strpos($part->getContentType(), 'text/html') === 0) {
             $this->inliner->setHtml($part->getBody());
             $message->setBody($this->inliner->emogrify());
         }
     }
 }
开发者ID:snowfire,项目名称:beautymail,代码行数:20,代码来源:CssInlinerPlugin.php

示例10: beforeSendPerformed

 /**
  * @param Swift_Events_SendEvent $evt
  */
 public function beforeSendPerformed(\Swift_Events_SendEvent $evt)
 {
     $message = $evt->getMessage();
     $converter = new CssToInlineStyles();
     $converter->setEncoding($message->getCharset());
     $converter->setUseInlineStylesBlock();
     $converter->setCleanup();
     if ($message->getContentType() === 'text/html' || $message->getContentType() === 'multipart/alternative' && $message->getBody() || $message->getContentType() === 'multipart/mixed' && $message->getBody()) {
         $converter->setHTML($message->getBody());
         $message->setBody($converter->convert());
     }
     foreach ($message->getChildren() as $part) {
         if (strpos($part->getContentType(), 'text/html') === 0) {
             $converter->setHTML($part->getBody());
             $part->setBody($converter->convert());
         }
     }
 }
开发者ID:pabloroman,项目名称:laravel-mail-css-inliner,代码行数:21,代码来源:CssInlinerPlugin.php

示例11: beforeSendPerformed

 /**
  * {@inheritdoc}
  */
 public function beforeSendPerformed(\Swift_Events_SendEvent $event)
 {
     $message = $event->getMessage();
     if (!$this->isEnabled() || !$message instanceof \Swift_Message || in_array($message->getId(), $this->performed) || null === $message->getBody()) {
         return;
     }
     $dom = new \DOMDocument('1.0', 'utf-8');
     $internalErrors = libxml_use_internal_errors(true);
     $dom->loadHTML($message->getBody());
     libxml_use_internal_errors($internalErrors);
     $xpath = new \DOMXPath($dom);
     $nodes = $xpath->query('//img/@src');
     $images = array();
     foreach ($nodes as $node) {
         $this->embedImage($message, $node, $images);
     }
     $message->setBody($dom->saveHTML(), 'text/html');
     $this->performed[] = $message->getId();
 }
开发者ID:sonatra,项目名称:SonatraMailerBundle,代码行数:22,代码来源:EmbedImagePlugin.php

示例12: sendPerformed

 /**
  * Invoked immediately after the Message is sent.
  *
  * @param Swift_Events_SendEvent $evt
  */
 public function sendPerformed(Swift_Events_SendEvent $evt)
 {
     $message = $evt->getMessage();
     $message->toByteStream($this);
 }
开发者ID:HaliteChallenge,项目名称:Halite,代码行数:10,代码来源:BandwidthMonitorPlugin.php

示例13: beforeSendPerformed

 /**
  * Invoked immediately before the Message is sent.
  *
  * @param \Swift_Events_SendEvent $event
  */
 public function beforeSendPerformed(\Swift_Events_SendEvent $event)
 {
     $event->getMessage()->setFrom($this->address, $this->name);
 }
开发者ID:amirkheirabadi,项目名称:pagekit,代码行数:9,代码来源:ImpersonatePlugin.php

示例14: beforeSendPerformed

 /**
  * Called just before Swift sends a message.
  * We perform operations on the message here.
  * @param Swift_Events_SendEvent The event object for sending a message
  */
 public function beforeSendPerformed(Swift_Events_SendEvent $e)
 {
     $message = $e->getMessage();
     $this->recursiveRestore($message, $this->store);
     //3.3.3 bugfix
     $recipients = $e->getRecipients();
     $to = array_keys($recipients->getTo());
     if (count($to) > 0) {
         $to = $to[0];
     } else {
         return;
     }
     $replacements = (array) $this->replacements->getReplacementsFor($to);
     $this->store = array("headers" => array(), "body" => false, "children" => array());
     $this->recursiveReplace($message, $replacements, $this->store);
 }
开发者ID:kjgarza,项目名称:ushahidi,代码行数:21,代码来源:Decorator.php

示例15: testMultiArray

 public function testMultiArray()
 {
     $transport = \Swift_MailTransport::newInstance();
     $message = \Swift_Message::newInstance('Wonderful Subject')->setFrom(array('john@doe.com' => 'John Doe'))->setTo(array('info@rollerscapes.net', 'webmaster@google.nl'));
     $message->setBody('Here is the message itself');
     $oLooseAttachment = \Swift_Attachment::newInstance('this an none-test document', 'Invoice-2011-848.txt', 'plain/text');
     $message->attach($oLooseAttachment);
     $sendEvent = new \Swift_Events_SendEvent($transport, $message);
     $replacements = array('info@rollerscapes.net' => array(\Swift_Attachment::newInstance('this an test document', 'Invoice-2011-4342.txt', 'plain/text')), 'webmaster@google.nl' => array(\Swift_Attachment::newInstance('this an none-test document', 'Invoice-2011-8480.txt', 'plain/text'), array('data' => 'this an none-test2 document', 'filename' => 'Invoice-2011-8580.txt')));
     $mailDecorator = new AttachmentDecorator($replacements);
     foreach ($replacements as $email => $msgReplacements) {
         $sendEvent->getMessage()->setTo($email);
         $mailDecorator->beforeSendPerformed($sendEvent);
         $message = $sendEvent->getMessage();
         $this->assertEquals('Here is the message itself', trim($message->getBody()));
         $children = (array) $message->getChildren();
         $attachments = array();
         foreach ($children as $child) {
             if (\Swift_Mime_MimeEntity::LEVEL_MIXED === $child->getNestingLevel() && 'Invoice-2011-848.txt' == $child->getFilename()) {
                 continue;
             }
             if (\Swift_Mime_MimeEntity::LEVEL_MIXED === $child->getNestingLevel()) {
                 $attachments[] = $child;
             }
         }
         $this->assertEquals($attachments, $attachments);
         $mailDecorator->sendPerformed($sendEvent);
         $children = (array) $message->getChildren();
         // Check to make sure the original Attachment is still there
         foreach ($children as $child) {
             if (\Swift_Mime_MimeEntity::LEVEL_MIXED === $child->getNestingLevel()) {
                 $this->assertEquals($oLooseAttachment->toString(), $child->toString());
             }
         }
     }
 }
开发者ID:rollerworks,项目名称:RollerworksMailBundle,代码行数:36,代码来源:MailAttachmentTest.php


注:本文中的Swift_Events_SendEvent::getMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。