Skip to content
Snippets Groups Projects
Commit 34e9ccf8 authored by Florian Azizian's avatar Florian Azizian
Browse files

FIX #13676 TIME 0:10 Set globals id in sendEmail script

parent 1d554125
No related branches found
No related tags found
No related merge requests found
......@@ -643,17 +643,11 @@ class EmailController
$phpmailer->SMTPDebug = 1;
$phpmailer->Debugoutput = function ($str) {
if (strpos($str, 'SMTP ERROR') !== false) {
if (!empty($GLOBALS['id'])) {
$user = $GLOBALS['id'];
} else {
$user = UserModel::get(['select' => ['id'], 'orderBy' => ["user_id='superadmin' desc"], 'limit' => 1])[0]['id'];
}
HistoryController::add([
'tableName' => 'emails',
'recordId' => 'email',
'eventType' => 'ERROR',
'eventId' => 'sendEmail',
'userId' => $user,
'info' => $str
]);
}
......
......@@ -40,6 +40,7 @@ class EmailScript
$currentUser = UserModel::getById(['id' => $args['userId'], 'select' => ['user_id']]);
$GLOBALS['login'] = $currentUser['user_id'];
$GLOBALS['id'] = $args['userId'];
$_SERVER['MAARCH_ENCRYPT_KEY'] = $args['encryptKey'];
$isSent = EmailController::sendEmail(['emailId' => $args['emailId'], 'userId' => $args['userId']]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment