fix: [internal] return true from the external email sender if no mocking is happening instead of the full email

pull/5084/head
iglocska 2019-08-30 11:19:43 +02:00
parent db3ac8acc5
commit 8418e8ee57
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
1 changed files with 5 additions and 0 deletions

View File

@ -777,11 +777,16 @@ class User extends AppModel
}
}
$Email->attachments($attachments);
$mock = false;
if (Configure::read('MISP.disable_emailing') || !empty($params['mock'])) {
$Email->transport('Debug');
$mock = true;
}
$result = $Email->send($params['body']);
$Email->reset();
if ($result && !$mock) {
return true;
}
return $result;
}
return false;