[+] добавлен функционал почтовых рассылок
This commit is contained in:
1 parent
a2eae57a11
commit
689753ddf1
7 files changed
+232
-382
No files matched your search
+1
-31
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user