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


PHP Email::getFromEmailAddress方法代碼示例

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


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

示例1: getFromNameLink

 /**
  * @param Email $email
  *
  * @return bool|string
  */
 protected function getFromNameLink(Email $email)
 {
     $path = false;
     if ($email->getFromEmailAddress() && $email->getFromEmailAddress()->getOwner()) {
         $className = $email->getFromEmailAddress()->getOwner()->getClass();
         $routeName = $this->configManager->getEntityMetadata($className)->getRoute('view', false);
         $path = $this->router->generate($routeName, ['id' => $email->getFromEmailAddress()->getOwner()->getId()]);
     }
     return $path;
 }
開發者ID:northdakota,項目名稱:platform,代碼行數:15,代碼來源:EmailNotificationManager.php

示例2: testFromEmailAddressGetterAndSetter

 public function testFromEmailAddressGetterAndSetter()
 {
     $emailAddress = $this->getMock('Oro\\Bundle\\EmailBundle\\Entity\\EmailAddress');
     $entity = new Email();
     $entity->setFromEmailAddress($emailAddress);
     $this->assertTrue($emailAddress === $entity->getFromEmailAddress());
 }
開發者ID:xamin123,項目名稱:platform,代碼行數:7,代碼來源:EmailTest.php

示例3: getEmails

 /**
  * Gets all(FROM, TO, CC, BCC) emails.
  *
  * @param Email $email
  *
  * @return string[]
  */
 protected function getEmails(Email $email)
 {
     $emails = [];
     foreach ($email->getRecipients() as $recipient) {
         $emails[] = $recipient->getEmailAddress()->getEmail();
     }
     $emails[] = $email->getFromEmailAddress()->getEmail();
     return array_unique($emails);
 }
開發者ID:ramunasd,項目名稱:platform,代碼行數:16,代碼來源:EmailActivitySuggestionApiEntityManager.php

示例4: addSenderOwner

 /**
  * @param array $targets
  * @param Email $email
  */
 protected function addSenderOwner(&$targets, Email $email)
 {
     $from = $email->getFromEmailAddress();
     if ($from) {
         $owner = $from->getOwner();
         if ($owner) {
             $this->addTarget($targets, $owner);
         }
     }
 }
開發者ID:xamin123,項目名稱:platform,代碼行數:14,代碼來源:EmailActivityManager.php

示例5: addSenderOwner

 /**
  * @param array $targets
  * @param Email $email
  */
 protected function addSenderOwner(&$targets, Email $email)
 {
     $from = $email->getFromEmailAddress();
     if (!$from) {
         return;
     }
     $owner = $from->getOwner();
     if (!$owner) {
         return;
     }
     // @todo: Should be deleted after email sync process will be refactored
     $token = $this->tokenStorage->getToken();
     if ($token) {
         $ownerOrganization = $this->entityOwnerAccessorLink->getService()->getOrganization($owner);
         if ($ownerOrganization && $token instanceof OrganizationContextTokenInterface && $token->getOrganizationContext()->getId() !== $ownerOrganization->getId()) {
             return;
         }
     }
     $this->addTarget($targets, $owner);
 }
開發者ID:startupz,項目名稱:platform-1,代碼行數:24,代碼來源:EmailActivityManager.php

示例6: createReplyAllEmailModel

 /**
  * @param EmailEntity $parentEmailEntity
  *
  * @return EmailModel
  */
 public function createReplyAllEmailModel(EmailEntity $parentEmailEntity)
 {
     $emailModel = $this->factory->getEmail();
     $emailModel->setMailType(EmailModel::MAIL_TYPE_REPLY);
     $emailModel->setParentEmailId($parentEmailEntity->getId());
     $fromAddress = $parentEmailEntity->getFromEmailAddress();
     if ($fromAddress->getOwner() === $this->helper->getUser()) {
         $toList = [];
         foreach ($parentEmailEntity->getTo() as $toRecipient) {
             $toEmail = $toRecipient->getEmailAddress()->getEmail();
             $this->helper->preciseFullEmailAddress($toEmail);
             $toList[] = $toEmail;
         }
         $ccList = [];
         foreach ($parentEmailEntity->getCc() as $ccRecipient) {
             $toEmail = $ccRecipient->getEmailAddress()->getEmail();
             $this->helper->preciseFullEmailAddress($toEmail);
             $ccList[] = $toEmail;
         }
         $emailModel->setTo($toList);
         $emailModel->setCc($ccList);
         $emailModel->setFrom($fromAddress->getEmail());
     } else {
         $toEmail = $fromAddress->getEmail();
         $this->helper->preciseFullEmailAddress($toEmail);
         $emailModel->setTo([$toEmail]);
         $this->initReplyAllFrom($emailModel, $parentEmailEntity);
     }
     $emailModel->setSubject($this->helper->prependWith('Re: ', $parentEmailEntity->getSubject()));
     $body = $this->helper->getEmailBody($parentEmailEntity, 'OroEmailBundle:Email/Reply:parentBody.html.twig');
     $emailModel->setBodyFooter($body);
     $emailModel->setContexts($this->activityListProvider->getTargetEntities($parentEmailEntity));
     return $this->createEmailModel($emailModel);
 }
開發者ID:ramunasd,項目名稱:platform,代碼行數:39,代碼來源:EmailModelBuilder.php

示例7: createReplyEmailModel

 /**
  * @param EmailEntity $parentEmailEntity
  *
  * @return EmailModel
  */
 public function createReplyEmailModel(EmailEntity $parentEmailEntity)
 {
     $emailModel = $this->factory->getEmail();
     $emailModel->setMailType(EmailModel::MAIL_TYPE_REPLY);
     $emailModel->setParentEmailId($parentEmailEntity->getId());
     $fromAddress = $parentEmailEntity->getFromEmailAddress();
     if ($fromAddress->getOwner() == $this->helper->getUser()) {
         $emailModel->setTo([$parentEmailEntity->getTo()->first()->getEmailAddress()->getEmail()]);
         $emailModel->setFrom($fromAddress->getEmail());
     } else {
         $emailModel->setTo([$fromAddress->getEmail()]);
         $this->initReplyFrom($emailModel, $parentEmailEntity);
     }
     $emailModel->setSubject($this->helper->prependWith('Re: ', $parentEmailEntity->getSubject()));
     $body = $this->helper->getEmailBody($parentEmailEntity, 'OroEmailBundle:Email/Reply:parentBody.html.twig');
     $emailModel->setBodyFooter($body);
     $emailModel->setContexts($this->activityListProvider->getTargetEntities($parentEmailEntity));
     return $this->createEmailModel($emailModel);
 }
開發者ID:nmallare,項目名稱:platform,代碼行數:24,代碼來源:EmailModelBuilder.php


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