1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-27 06:01:54 +03:00

Updated email test send to show error on failure

- Added test to cover
- Closes #1874
This commit is contained in:
Dan Brown
2020-02-15 14:13:15 +00:00
parent 33ef1cd4fa
commit 49386b42da
3 changed files with 30 additions and 2 deletions

View File

@ -122,8 +122,14 @@ class SettingController extends Controller
{
$this->checkPermission('settings-manage');
user()->notify(new TestEmail());
$this->showSuccessNotification(trans('settings.maint_send_test_email_success', ['address' => user()->email]));
try {
user()->notify(new TestEmail());
$this->showSuccessNotification(trans('settings.maint_send_test_email_success', ['address' => user()->email]));
} catch (\Exception $exception) {
$errorMessage = trans('errors.maintenance_test_email_failure') . "\n" . $exception->getMessage();
$this->showErrorNotification($errorMessage);
}
return redirect('/settings/maintenance#image-cleanup')->withInput();
}