mirror of
https://github.com/friendica/friendica
synced 2024-12-22 22:40:16 +00:00
Add App->getSenderEmailAddress method
This commit is contained in:
parent
59d42e9681
commit
a86d1806ae
1 changed files with 20 additions and 0 deletions
20
src/App.php
20
src/App.php
|
@ -1047,4 +1047,24 @@ class App
|
|||
unset($this->config[$uid][$cat][$k]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates the site's default sender email address
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSenderEmailAddress()
|
||||
{
|
||||
$sender_email = Config::get('config', 'sender_email');
|
||||
if (empty($sender_email)) {
|
||||
$hostname = $this->get_hostname();
|
||||
if (strpos($hostname, ':')) {
|
||||
$hostname = substr($hostname, 0, strpos($hostname, ':'));
|
||||
}
|
||||
|
||||
$sender_email = L10n::t('noreply') . '@' . $hostname;
|
||||
}
|
||||
|
||||
return $sender_email;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue