function OriginatorSubscriber::getSiteAddress
Returns the site email address.
Parameters
string|null $langcode: The language code from the email.
2 calls to OriginatorSubscriber::getSiteAddress()
- OriginatorSubscriber::setDefaultFrom in core/
lib/ Drupal/ Core/ Mailer/ EventSubscriber/ OriginatorSubscriber.php - Sets the default from address.
- OriginatorSubscriber::setDefaultSender in core/
lib/ Drupal/ Core/ Mailer/ EventSubscriber/ OriginatorSubscriber.php - Sets the default sender address.
File
-
core/
lib/ Drupal/ Core/ Mailer/ EventSubscriber/ OriginatorSubscriber.php, line 105
Class
- OriginatorSubscriber
- Message subscriber which sets the from and sender headers.
Namespace
Drupal\Core\Mailer\EventSubscriberCode
protected function getSiteAddress(?string $langcode) : Address {
return $this->executeInEnvironment($langcode, function () {
$config = $this->configFactory
->get('system.site');
return new Address($config->get('mail'), $config->get('name'));
});
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.