本文整理匯總了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);
}