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


PHP Message::getSwiftMessage方法代码示例

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


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

示例1: testGetAttachments

 public function testGetAttachments()
 {
     $getAttachment = \Closure::bind(function ($message) {
         return $this->getAttachments($message);
     }, $this->transport, 'Sichikawa\\LaravelSendgridDriver\\Transport\\SendgridTransport');
     $message = new Message($this->getMessage());
     $file = __DIR__ . '/test.png';
     $message->attach($file);
     $res = $getAttachment($message->getSwiftMessage());
     $this->assertEquals(base64_encode(file_get_contents($file)), array_get($res, '0.content'));
     $this->assertEquals('test.png', array_get($res, '0.filename'));
 }
开发者ID:s-ichikawa,项目名称:laravel-sendgrid-driver-v3,代码行数:12,代码来源:SendgridTransportTest.php

示例2: runCallbacks

 /**
  * Run the callbacks for the message.
  *
  * @param  \Illuminate\Mail\Message  $message
  * @return $this
  */
 protected function runCallbacks($message)
 {
     foreach ($this->callbacks as $callback) {
         $callback($message->getSwiftMessage());
     }
     return $this;
 }
开发者ID:scrubmx,项目名称:framework,代码行数:13,代码来源:Mailable.php

示例3: addContent

 /**
  * Add the content to a given message.
  *
  * @param  \Illuminate\Mail\Message $message
  * @param  string $view
  * @param  string $plain
  * @param  array $data
  * @return void
  */
 protected function addContent($message, $view, $plain, $raw, $data)
 {
     /*
      * Extensibility
      */
     if ($this->fireEvent('mailer.beforeAddContent', [$message, $view, $data], true) === false || Event::fire('mailer.beforeAddContent', [$this, $message, $view, $data], true) === false) {
         return;
     }
     $html = null;
     $text = null;
     if (isset($view)) {
         $viewContent = $this->getView($view, $data);
         $result = MailParser::parse($viewContent);
         $html = $result['html'];
         if ($result['text']) {
             $text = $result['text'];
         }
         /*
          * Subject
          */
         $customSubject = $message->getSwiftMessage()->getSubject();
         if (empty($customSubject) && ($subject = array_get($result['settings'], 'subject'))) {
             $message->subject($subject);
         }
     }
     if (isset($plain)) {
         $text = $this->getView($plain, $data);
     }
     if (isset($raw)) {
         $text = $raw;
     }
     $this->addContentRaw($message, $html, $text);
     /*
      * Extensibility
      */
     $this->fireEvent('mailer.addContent', [$message, $view, $data]);
     Event::fire('mailer.addContent', [$this, $message, $view, $data]);
 }
开发者ID:nevinsm,项目名称:personalSite,代码行数:47,代码来源:Mailer.php

示例4: testSetSmtpApi

 public function testSetSmtpApi()
 {
     $setSmtpApi = \Closure::bind(function (&$data, $message) {
         return $this->setSmtpApi($data, $message);
     }, $this->transport, 'Sichikawa\\LaravelSendgridDriver\\Transport\\SendGridTransport');
     $data = [];
     $message = new Message($this->getMessage());
     $message->embedData(['category' => 'foo'], 'sendgrid/x-smtpapi');
     $setSmtpApi($data, $message->getSwiftMessage());
     $this->assertEquals(json_encode(['category' => 'foo']), $data['x-smtpapi']);
 }
开发者ID:alexdeoliveira,项目名称:laravel-sendgrid-driver,代码行数:11,代码来源:SendgridTransportTest.php

示例5: testGetSwiftMessageMethod

 public function testGetSwiftMessageMethod()
 {
     $this->assertInstanceOf(Swift_Mime_Message::class, $this->message->getSwiftMessage());
 }
开发者ID:viserio,项目名称:mail,代码行数:4,代码来源:MessageTest.php

示例6: testSetPersonalizations

 public function testSetPersonalizations()
 {
     $setParameters = \Closure::bind(function ($message, $data) {
         return $this->setParameters($message, $data);
     }, $this->transport, SendgridV3Transport::class);
     $personalizations = [['substitutions' => ['substitutions_key' => 'substitutions_value'], 'custom_args' => ['custom_args_key' => 'custom_args_value'], 'send_at' => time()]];
     $message = new Message($this->getMessage());
     $message->embedData(['personalizations' => $personalizations], 'sendgrid/x-smtpapi');
     $data = [];
     $data = $setParameters($message->getSwiftMessage(), $data);
     $this->assertEquals(['personalizations' => $personalizations], $data);
 }
开发者ID:s-ichikawa,项目名称:laravel-sendgrid-driver,代码行数:12,代码来源:SendgridV3TransportTest.php


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