當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Swift_Message::getContentType方法代碼示例

本文整理匯總了PHP中Swift_Message::getContentType方法的典型用法代碼示例。如果您正苦於以下問題:PHP Swift_Message::getContentType方法的具體用法?PHP Swift_Message::getContentType怎麽用?PHP Swift_Message::getContentType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Swift_Message的用法示例。


在下文中一共展示了Swift_Message::getContentType方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: createMessage

 /**
  * @param Swift_Message $message
  *
  * @return Swift_Message
  */
 protected function createMessage(Swift_Message $message)
 {
     $mimeEntity = new Swift_Message('', $message->getBody(), $message->getContentType(), $message->getCharset());
     $mimeEntity->setChildren($message->getChildren());
     $messageHeaders = $mimeEntity->getHeaders();
     $messageHeaders->remove('Message-ID');
     $messageHeaders->remove('Date');
     $messageHeaders->remove('Subject');
     $messageHeaders->remove('MIME-Version');
     $messageHeaders->remove('To');
     $messageHeaders->remove('From');
     return $mimeEntity;
 }
開發者ID:NivalM,項目名稱:VacantesJannaMotors,代碼行數:18,代碼來源:SMimeSigner.php

示例2: getContentType

 /**
  * {@inheritdoc}
  */
 public function getContentType()
 {
     return $this->message->getContentType();
 }
開發者ID:cawaphp,項目名稱:email,代碼行數:7,代碼來源:Message.php

示例3: testMimeTypeIsMixed

 /**
  * The multipart/mixed content-type is more significant than multipart/related.
  */
 public function testMimeTypeIsMixed()
 {
     $msg = new Swift_Message();
     $msg->attach(new Swift_Message_Part("foo"));
     $this->assertEqual("multipart/alternative", $msg->getContentType());
     $msg->attach(new Swift_Message_EmbeddedFile("bar"));
     $this->assertEqual("multipart/related", $msg->getContentType());
     $msg->attach(new Swift_Message_Attachment("zip"));
     $this->assertEqual("multipart/mixed", $msg->getContentType());
     $msg->attach(new Swift_Message_EmbeddedFile("button"));
     $this->assertEqual("multipart/mixed", $msg->getContentType());
 }
開發者ID:Esleelkartea,項目名稱:legedia-ESLE,代碼行數:15,代碼來源:TestOfMessage.php

示例4: assertSendCalled

 /**
  * @param string         $templateName
  * @param array          $templateParams
  * @param \Swift_Message $expectedMessage
  * @param string         $emailType
  */
 protected function assertSendCalled($templateName, array $templateParams, \Swift_Message $expectedMessage, $emailType = 'txt')
 {
     $this->emailTemplate->expects($this->once())->method('getType')->willReturn($emailType);
     $this->objectRepository->expects($this->once())->method('findOneBy')->with(['name' => $templateName])->willReturn($this->emailTemplate);
     $this->renderer->expects($this->once())->method('compileMessage')->with($this->emailTemplate, $templateParams)->willReturn([$expectedMessage->getSubject(), $expectedMessage->getBody()]);
     $to = $expectedMessage->getTo();
     $toKeys = array_keys($to);
     $this->emailHolderHelper->expects($this->once())->method('getEmail')->with($this->isInstanceOf('Oro\\Bundle\\UserBundle\\Entity\\UserInterface'))->willReturn(array_shift($toKeys));
     $this->mailer->expects($this->once())->method('send')->with($this->callback(function (\Swift_Message $actualMessage) use($expectedMessage) {
         $this->assertEquals($expectedMessage->getSubject(), $actualMessage->getSubject());
         $this->assertEquals($expectedMessage->getFrom(), $actualMessage->getFrom());
         $this->assertEquals($expectedMessage->getTo(), $actualMessage->getTo());
         $this->assertEquals($expectedMessage->getBody(), $actualMessage->getBody());
         $this->assertEquals($expectedMessage->getContentType(), $actualMessage->getContentType());
         return true;
     }));
 }
開發者ID:Maksold,項目名稱:platform,代碼行數:23,代碼來源:AbstractProcessorTest.php


注:本文中的Swift_Message::getContentType方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。