本文整理汇总了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;
}
示例2: testFromEmailAddressGetterAndSetter
public function testFromEmailAddressGetterAndSetter()
{
$emailAddress = $this->getMock('Oro\\Bundle\\EmailBundle\\Entity\\EmailAddress');
$entity = new Email();
$entity->setFromEmailAddress($emailAddress);
$this->assertTrue($emailAddress === $entity->getFromEmailAddress());
}
示例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);
}
示例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);
}
}
}
示例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);
}
示例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);
}
示例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);
}