fix(settings): log exception when test email fails

Signed-off-by: Abhinav Ohri <abhinavohri13@gmail.com>
This commit is contained in:
Abhinav Ohri 2025-12-07 17:36:22 +05:30 committed by backportbot[bot]
parent cec9ad1f13
commit 0d19b69340

View file

@ -147,6 +147,7 @@ class MailSettingsController extends Controller {
return new DataResponse();
} catch (\Exception $e) {
$this->config->setAppValue('core', 'emailTestSuccessful', '0');
$this->logger->error('Failed sending test email: ' . $e->getMessage(), ['exception' => $e]);
return new DataResponse($this->l10n->t('A problem occurred while sending the email. Please revise your settings. (Error: %s)', [$e->getMessage()]), Http::STATUS_BAD_REQUEST);
}
}