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


PHP Swift_Mime_Message::getBody方法代码示例

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


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

示例1: returnOneValidateCampaignUrls

 public function returnOneValidateCampaignUrls(\Swift_Mime_Message $message, &$failedRecipients = null)
 {
     $body = $message->getBody();
     // has a email-tracking-image at the end
     $this->assertContains("<img src='https://www.google-analytics.com/?tid=blabla", $body, "Email open tracking image not found.");
     // links have tracking-parameters
     $this->assertContains("&utm_medium=email", $body, "Email links are expected to have tracking parameters attached.");
     return 1;
 }
开发者ID:azine,项目名称:email-bundle,代码行数:9,代码来源:AzineTwigSwiftMailerTest.php

示例2: transform

 /**
  * {@inheritdoc)
  */
 public function transform(\Swift_Mime_Message $message)
 {
     $processor = new Process($this->getCommand());
     $processor->setStdin($message->getBody());
     $processor->run();
     if ($processor->isSuccessful()) {
         $message->addPart($processor->getOutput(), 'text/plain');
     }
 }
开发者ID:rezzza,项目名称:MailExtraBundle,代码行数:12,代码来源:Html2TextTransformer.php

示例3: send

 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());
 }
开发者ID:cargomedia,项目名称:cm,代码行数:15,代码来源:Log.php

示例4: transform

 /**
  * {@inheritdoc)
  */
 public function transform(\Swift_Mime_Message $message)
 {
     $body = $message->getBody();
     $body = preg_replace_callback('/(src|background)="(http[^"]*)"/', function ($matches) use($message) {
         $attribute = $matches[1];
         $imagePath = $matches[2];
         if ($fp = fopen($imagePath, "r")) {
             $imagePath = $message->embed(\Swift_Image::fromPath($imagePath));
             fclose($fp);
         }
         return sprintf('%s="%s"', $attribute, $imagePath);
     }, $body);
     $body = preg_replace_callback('/url\\((http[^"]*)\\)/', function ($matches) use($message) {
         $imagePath = $matches[1];
         if ($fp = fopen($imagePath, "r")) {
             $imagePath = $message->embed(\Swift_Image::fromPath($imagePath));
             fclose($fp);
         }
         return sprintf('url(%s)', $imagePath);
     }, $body);
     $message->setBody($body, 'text/html');
 }
开发者ID:rezzza,项目名称:MailExtraBundle,代码行数:25,代码来源:PictureEmbedTransformer.php

示例5: content

 /**
  * Get the HTML content for the preview file.
  *
  * @return string
  */
 private function content()
 {
     return $this->info() . $this->message->getBody();
 }
开发者ID:laravelflare,项目名称:mail-debug,代码行数:9,代码来源:MailDebugManager.php

示例6: Html2Text

 /**
  * Define email to text/plain
  *
  * @param \Swift_Mime_Message $message E-mail message
  *
  * @access public
  * @return void
  * @author Etienne de Longeaux <etienne.delongeaux@gmail.com>
  */
 public function Html2Text(\Swift_Mime_Message &$message)
 {
     $text = strip_tags($message->getBody());
     $message->addPart($text, 'text/plain');
 }
开发者ID:pigroupe,项目名称:SfynxToolBundle,代码行数:14,代码来源:PiMailerManager.php


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