fix: log sendTestEmail errors and show error toast for 15s so it can be read
This commit is contained in:
parent
9115bc9630
commit
c6a12163bb
@ -84,6 +84,7 @@ class MailAccountController extends Controller
|
|||||||
);
|
);
|
||||||
return response()->json(['success' => true]);
|
return response()->json(['success' => true]);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
\Illuminate\Support\Facades\Log::error('sendTestEmail failed: ' . $e->getMessage(), ['account' => $mailAccount->name]);
|
||||||
return response()->json(['success' => false, 'message' => $e->getMessage()]);
|
return response()->json(['success' => false, 'message' => $e->getMessage()]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -705,7 +705,7 @@ function sendTestEmail() {
|
|||||||
showToast('Test email sent!', 'success');
|
showToast('Test email sent!', 'success');
|
||||||
} else {
|
} else {
|
||||||
statusEl.textContent = 'Failed.'; statusEl.style.color = '#dc2626';
|
statusEl.textContent = 'Failed.'; statusEl.style.color = '#dc2626';
|
||||||
showToast(data.message || 'Failed to send.', 'error');
|
showToast(data.message || 'Failed to send.', 'error', 15000);
|
||||||
}
|
}
|
||||||
}).catch(function() {
|
}).catch(function() {
|
||||||
statusEl.textContent = 'Request failed.'; statusEl.style.color = '#dc2626';
|
statusEl.textContent = 'Request failed.'; statusEl.style.color = '#dc2626';
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user