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.

This commit is contained in:
redmatrix
2016-10-01 03:06:01 -07:00
parent ad309f1036
commit fa94644bcf
6 changed files with 4886 additions and 4789 deletions

View File

@@ -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,