chore: /api/notify/email/config gönderen adresini ve EMAIL_FROM'un ayarlı olup olmadığını raporlasın
EMAIL_FROM'un konteynere ulaşıp ulaşmadığını tahmin etmek yerine ölçmek için.
This commit is contained in:
+7
-2
@@ -17,7 +17,7 @@ import path from 'node:path';
|
|||||||
import { fileURLToPath } from 'node:url';
|
import { fileURLToPath } from 'node:url';
|
||||||
import { readDtTenders } from './dt-store.mjs';
|
import { readDtTenders } from './dt-store.mjs';
|
||||||
import { loginWithGoogle, userFromAuthHeader } from './auth.mjs';
|
import { loginWithGoogle, userFromAuthHeader } from './auth.mjs';
|
||||||
import { emailConfigured, sendEmail, tenderDigestHtml } from './email.mjs';
|
import { emailConfigured, sendEmail, tenderDigestHtml, emailFrom } from './email.mjs';
|
||||||
import { aiConfigured, availableProviders, analyzeSpec } from './ai.mjs';
|
import { aiConfigured, availableProviders, analyzeSpec } from './ai.mjs';
|
||||||
import { billingConfigured, planCatalog, createCheckoutSession } from './billing.mjs';
|
import { billingConfigured, planCatalog, createCheckoutSession } from './billing.mjs';
|
||||||
import { searchTed } from './ted.mjs';
|
import { searchTed } from './ted.mjs';
|
||||||
@@ -626,7 +626,12 @@ const server = http.createServer(async (req, res) => {
|
|||||||
|
|
||||||
// --- E-posta bildirimi (Resend) ---
|
// --- E-posta bildirimi (Resend) ---
|
||||||
if (url.pathname === '/api/notify/email/config') {
|
if (url.pathname === '/api/notify/email/config') {
|
||||||
return json(res, 200, { configured: emailConfigured() });
|
// 'from' gizli bilgi değil; hangi adresin kullanıldığını görünür kılar
|
||||||
|
return json(res, 200, {
|
||||||
|
configured: emailConfigured(),
|
||||||
|
from: emailFrom(),
|
||||||
|
envAyarli: Boolean((process.env.EMAIL_FROM || '').trim()),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
// Giriş yapan kullanıcının KENDİ e-postasına test/özet gönderir (kötüye kullanımı önler).
|
// Giriş yapan kullanıcının KENDİ e-postasına test/özet gönderir (kötüye kullanımı önler).
|
||||||
if (url.pathname === '/api/notify/email/test' && req.method === 'POST') {
|
if (url.pathname === '/api/notify/email/test' && req.method === 'POST') {
|
||||||
|
|||||||
Reference in New Issue
Block a user