You are here

public function SocialEventAnEnrollSendEmail::getEmail in Open Social 8.7

Same name and namespace in other branches
  1. 8.5 modules/social_features/social_event/modules/social_event_an_enroll/src/Plugin/Action/SocialEventAnEnrollSendEmail.php \Drupal\social_event_an_enroll\Plugin\Action\SocialEventAnEnrollSendEmail::getEmail()
  2. 8.6 modules/social_features/social_event/modules/social_event_an_enroll/src/Plugin/Action/SocialEventAnEnrollSendEmail.php \Drupal\social_event_an_enroll\Plugin\Action\SocialEventAnEnrollSendEmail::getEmail()

Returns the email address of this account.

Parameters

\Drupal\user\UserInterface $account: The user object.

Return value

string|null The email address, or NULL if the account is anonymous or the user does not have an email address.

Overrides SocialSendEmail::getEmail

File

modules/social_features/social_event/modules/social_event_an_enroll/src/Plugin/Action/SocialEventAnEnrollSendEmail.php, line 125

Class

SocialEventAnEnrollSendEmail
Send email to event enrollment users.

Namespace

Drupal\social_event_an_enroll\Plugin\Action

Code

public function getEmail(UserInterface $account) {
  if ($account
    ->isAnonymous()) {
    return $this->entity->field_email->value;
  }
  return parent::getEmail($account);
}