From fa94644bcfd5bb3ef9c4149d6503846a09975297 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sat, 1 Oct 2016 03:06:01 -0700 Subject: Unify the various mail sending instance to enotify::send() and z_mail(). Both take the same arguments. z_mail() is text only, enotify::send() provides html and text. Both are pluggable using the enotfy_send hook. --- Zotlabs/Lib/Enotify.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'Zotlabs/Lib') diff --git a/Zotlabs/Lib/Enotify.php b/Zotlabs/Lib/Enotify.php index 87a51b3a4..c25834a1f 100644 --- a/Zotlabs/Lib/Enotify.php +++ b/Zotlabs/Lib/Enotify.php @@ -71,9 +71,21 @@ class Enotify { // Do not translate 'noreply' as it must be a legal 7-bit email address - $sender_email = get_config('system','reply_address'); + $reply_email = get_config('system','reply_address'); + if(! $reply_email) + $reply_email = 'noreply' . '@' . $hostname; + + $sender_email = get_config('system','from_email'); if(! $sender_email) - $sender_email = 'noreply' . '@' . $hostname; + $sender_email = 'Administrator' . '@' . App::get_hostname(); + + + $sender_name = get_config('system','from_email_name'); + if(! $sender_name) + $sender_name = Zotlabs\Lib\System::get_site_name(); + + + $additional_mail_header = ""; @@ -586,7 +598,7 @@ class Enotify { self::send(array( 'fromName' => $sender_name, 'fromEmail' => $sender_email, - 'replyTo' => $sender_email, + 'replyTo' => $reply_email, 'toEmail' => $recip['account_email'], 'messageSubject' => $datarray['subject'], 'htmlVersion' => $email_html_body, -- cgit v1.2.3