public function Mailer::getFrom in Simplenews 8
Same name and namespace in other branches
- 8.2 src/Mail/Mailer.php \Drupal\simplenews\Mail\Mailer::getFrom()
- 3.x src/Mail/Mailer.php \Drupal\simplenews\Mail\Mailer::getFrom()
Build formatted from-name and email for a mail object.
Return value
array Associative array with (un)formatted from address 'address' => From address 'formatted' => Formatted, mime encoded, from name and address
Overrides MailerInterface::getFrom
1 call to Mailer::getFrom()
- Mailer::sendCombinedConfirmation in src/
Mail/ Mailer.php - Send collected confirmations.
File
- src/
Mail/ Mailer.php, line 477
Class
- Mailer
- Default Mailer.
Namespace
Drupal\simplenews\MailCode
public function getFrom() {
$address = $this->config
->get('newsletter.from_address');
$name = $this->config
->get('newsletter.from_name');
// Windows based PHP systems don't accept formatted email addresses.
$formatted_address = mb_substr(PHP_OS, 0, 3) == 'WIN' ? $address : '"' . addslashes(Unicode::mimeHeaderEncode($name)) . '" <' . $address . '>';
return array(
'address' => $address,
'formatted' => $formatted_address,
);
}