fix(reminders): support OAuth SMTP accounts (#5649)

This commit is contained in:
RaresKeY
2026-07-22 16:03:35 +02:00
committed by GitHub
parent 65987fc772
commit d49629fa14
3 changed files with 74 additions and 7 deletions
+7 -2
View File
@@ -2412,11 +2412,16 @@ async function initReminderSettings() {
// what the Integrations panel manages. Treat the email channel as
// configured if there's at least one account with SMTP set.
let emailAccounts = [];
const smtpAccountReady = (account) => !!(
account.smtp_host
&& account.smtp_user
&& (account.has_smtp_password || account.oauth_provider === 'google')
);
try {
const res = await fetch('/api/email/accounts', { credentials: 'same-origin' });
if (res.ok) {
const d = await res.json();
emailAccounts = (d.accounts || []).filter(a => a.smtp_host && a.smtp_user && a.has_smtp_password);
emailAccounts = (d.accounts || []).filter(smtpAccountReady);
}
} catch (_) {}
let smtpConfigured = emailAccounts.length > 0;
@@ -2520,7 +2525,7 @@ async function initReminderSettings() {
const res = await fetch('/api/email/accounts', { credentials: 'same-origin' });
if (res.ok) {
const d = await res.json();
emailAccounts = (d.accounts || []).filter(a => a.smtp_host && a.smtp_user && a.has_smtp_password);
emailAccounts = (d.accounts || []).filter(smtpAccountReady);
}
} catch (_) {}
smtpConfigured = emailAccounts.length > 0;