当前位置: 首页>>代码示例>>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;未经允许,请勿转载。