From 689753ddf11c8214fcd36aaa3575e2dc589fbdf3 Mon Sep 17 00:00:00 2001 From: rsgrinko Date: Thu, 9 Dec 2021 23:01:47 +0300 Subject: [PATCH] =?UTF-8?q?[+]=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D0=BE=D0=BD?= =?UTF-8?q?=D0=B0=D0=BB=20=D0=BF=D0=BE=D1=87=D1=82=D0=BE=D0=B2=D1=8B=D1=85?= =?UTF-8?q?=20=D1=80=D0=B0=D1=81=D1=81=D1=8B=D0=BB=D0=BE=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/mail_templates/default.html | 8 +- inc/func.php | 32 +-- inc/header.php | 2 +- inc/lib/CMail.class.php | 427 ++++++----------------------- login.php | 4 +- mailings.php | 139 +++++++++- test2.php | 2 +- 7 files changed, 232 insertions(+), 382 deletions(-) diff --git a/assets/mail_templates/default.html b/assets/mail_templates/default.html index c6f302b..217eff7 100644 --- a/assets/mail_templates/default.html +++ b/assets/mail_templates/default.html @@ -81,7 +81,10 @@ .container .masthead { padding: 18px 0; background: #71bc37; - color: white; } + color: white; + margin-top: 40px; + display: block; + } .container .masthead h1 { margin: 0 auto !important; max-width: 90%; } @@ -124,7 +127,6 @@ -

{FOOTER}

@@ -135,7 +137,7 @@ diff --git a/inc/func.php b/inc/func.php index 490c686..6463774 100644 --- a/inc/func.php +++ b/inc/func.php @@ -274,36 +274,6 @@ function getOS() { } - /** - * Отправка уведомления на почту администратору с использованием шаблонов - */ -function adminSendMailWithTemplate($template, $subject, $message, $file = false){ - $mail = new CMail; - $mail->from('iot@'.$_SERVER['SERVER_NAME'], 'Система оповещений IoT Core'); - $mail->to(ADMIN_EMAIL, 'Администратор панели'); - $mail->subject = $subject; - $mail->assignTemplateVars( - array( - 'HEADER' => 'IoT Core', - 'MESSAGE' => 'test0', - 'TITLE' => 'test title', - 'LINK' => 'https://it-stories.ru/', - 'LINKNAME' => 'Go to site', - 'FOOTER' => 'Thanks!', - 'SERVERNAME' => 'it-stories.ru' - ) - ); - - - - // прикрепляем лог, если он есть - if(isset($file) and !empty($file) and file_exists($file)){ - $mail->addFile($file); - } - $mail->sendUsingTemplate($template); - - return; - } /** * Отправка уведомления пользователю * @@ -332,7 +302,7 @@ function adminSendMailWithTemplate($template, $subject, $message, $file = false) if(isset($file) and !empty($file) and file_exists($file)){ $mail->addFile($file); } - $mail->send(); + $mail->sendDefault(); return; } diff --git a/inc/header.php b/inc/header.php index e0eddb7..1bc3223 100644 --- a/inc/header.php +++ b/inc/header.php @@ -162,7 +162,7 @@ if(!CUser::is_user() and $_SERVER['REQUEST_URI'] !== '/login.php') {