本文整理汇总了PHP中Oro\Bundle\UserBundle\Entity\User::getEmail方法的典型用法代码示例。如果您正苦于以下问题:PHP User::getEmail方法的具体用法?PHP User::getEmail怎么用?PHP User::getEmail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Oro\Bundle\UserBundle\Entity\User
的用法示例。
在下文中一共展示了User::getEmail方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testEmail
public function testEmail()
{
$user = new User();
$mail = 'tony@mail.org';
$this->assertNull($user->getEmail());
$user->setEmail($mail);
$this->assertEquals($mail, $user->getEmail());
}
示例2: testSendEmail
/**
* @dataProvider sendEmailResultProvider
*
* @param User $user
* @param string $emailType
* @param string $expectedEmailType
*/
public function testSendEmail(User $user, $emailType, $expectedEmailType)
{
$templateName = 'email_template_name';
$templateParams = ['entity' => $user];
$expectedMessage = $this->buildMessage($user->getEmail(), 'email subject', 'email body', $expectedEmailType);
$this->assertSendCalled($templateName, $templateParams, $expectedMessage, $emailType);
$this->mailProcessor->getEmailTemplateAndSendEmail($user, $templateName, $templateParams);
}
示例3: buildFullEmailAddress
/**
* @param User $user
*
* @return string
*/
public function buildFullEmailAddress(User $user)
{
return $this->emailAddressHelper->buildFullEmailAddress($user->getEmail(), $this->entityNameResolver->getName($user));
}
示例4: sendInviteMail
/**
* Send invite email to new user
*
* @param User $user
* @param string $plainPassword
*
* @throws \RuntimeException
*/
protected function sendInviteMail(User $user, $plainPassword)
{
if (in_array(null, [$this->cm, $this->mailer, $this->templating], true)) {
throw new \RuntimeException('Unable to send invitation email, unmet dependencies detected.');
}
$senderEmail = $this->cm->get('oro_notification.email_notification_sender_email');
$senderName = $this->cm->get('oro_notification.email_notification_sender_name');
$message = \Swift_Message::newInstance()->setSubject('Invite user')->setFrom($senderEmail, $senderName)->setTo($user->getEmail())->setBody($this->templating->render('OroUserBundle:Mail:invite.html.twig', ['user' => $user, 'password' => $plainPassword]), 'text/html');
$this->mailer->send($message);
}
示例5: addEmailUser
/**
* @param $randomTemplate
* @param User $owner
* @param Contact $contact
* @param EmailOrigin $origin
*
* @return EmailUser
*/
protected function addEmailUser($randomTemplate, $owner, $contact, $origin)
{
$emailUser = $this->emailEntityBuilder->emailUser($this->templates[$randomTemplate]['Subject'], $owner->getEmail(), $contact->getPrimaryEmail()->getEmail(), new \DateTime('now'), new \DateTime('now'), new \DateTime('now'));
$this->setSecurityContext($owner);
$emailUser->setFolder($origin->getFolder(FolderType::SENT));
$emailUser->setOwner($owner);
$emailUser->setOrganization($owner->getOrganization());
$emailBody = $this->emailEntityBuilder->body("Hi,\n" . $this->templates[$randomTemplate]['Text'], false, true);
$emailUser->getEmail()->setEmailBody($emailBody);
$emailUser->getEmail()->setMessageId(sprintf('<id.%s@%s', uniqid(), '@bap.migration.generated>'));
return $emailUser;
}
示例6: testSendResetPasswordAsAdminEmail
public function testSendResetPasswordAsAdminEmail()
{
$this->assertSendCalled(Processor::TEMPLATE_USER_RESET_PASSWORD_AS_ADMIN, ['entity' => $this->user], $this->buildMessage($this->user->getEmail()));
$this->mailProcessor->sendResetPasswordAsAdminEmail($this->user);
}
示例7: getObfuscatedEmail
/**
* Get the truncated email displayed when requesting the resetting.
* The default implementation only keeps the part following @ in the address.
*
* @param User $user
*
* @return string
*/
protected function getObfuscatedEmail(User $user)
{
$email = $user->getEmail();
if (false !== ($pos = strpos($email, '@'))) {
$email = '...' . substr($email, $pos);
}
return $email;
}
示例8: getUserDependingOnType
/**
* @param OroUser|ApiUser|int $user
* @return \Diamante\UserBundle\Entity\DiamanteUser|\Oro\Bundle\UserBundle\Entity\User
*/
private function getUserDependingOnType($user)
{
if ($user instanceof OroUser) {
return $user;
}
if ($user instanceof ApiUser) {
$userId = $this->userService->verifyDiamanteUserExists($user->getEmail());
$user = empty($userId) ? $user : new User($userId, User::TYPE_DIAMANTE);
}
$result = $this->userService->getByUser($user);
return $result;
}
示例9: testSendRFPNotification
public function testSendRFPNotification()
{
$this->assertSendCalled(Processor::CREATE_REQUEST_TEMPLATE_NAME, ['entity' => $this->request], $this->buildMessage($this->user->getEmail()));
$this->mailProcessor->sendRFPNotification($this->request, $this->user);
}