]> git.mxchange.org Git - friendica.git/commitdiff
Add App->getSenderEmailAddress method
authorHypolite Petovan <mrpetovan@gmail.com>
Sat, 7 Apr 2018 01:47:16 +0000 (21:47 -0400)
committerHypolite Petovan <mrpetovan@gmail.com>
Sat, 7 Apr 2018 01:47:16 +0000 (21:47 -0400)
src/App.php

index 55623e1e812a6e07d9684817fbecf55b1dda02b1..1acd35ac348c52ea8c10adf42d3b53cda0b999c7 100644 (file)
@@ -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;
+       }
 }