function NotificationHandler::getAdminAddress

Same name and namespace in other branches
  1. 11.x core/modules/user/src/NotificationHandler.php \Drupal\user\NotificationHandler::getAdminAddress()

Returns the account admin email address.

Return value

non-empty-string|null Email address of the account admin.

File

core/modules/user/src/NotificationHandler.php, line 170

Class

NotificationHandler
Implements a service to dispatch user notification messages.

Namespace

Drupal\user

Code

protected function getAdminAddress() : ?string {
  // Get the custom site notification email if it has been set.
  $siteConfig = $this->configFactory
    ->get('system.site');
  $adminAddress = $siteConfig->get('mail_notification');
  // If the custom site notification email has not been set, we use the site
  // default for this.
  if (empty($adminAddress)) {
    $adminAddress = $siteConfig->get('mail');
  }
  return $adminAddress ?: NULL;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.