fix(analytics-mailer): send emails individually to avoid exposing other recipients in CC/To field
Some checks failed
Monorepo Pipeline / ⚡ Prioritize Release (push) Successful in 2s
Monorepo Pipeline / 🧹 Lint (push) Failing after 1m25s
Monorepo Pipeline / 🧪 Test (push) Successful in 43s
Monorepo Pipeline / 🏗️ Build (push) Successful in 2m8s
Monorepo Pipeline / 🚀 Release (push) Has been skipped
Monorepo Pipeline / 🐳 Build Gatekeeper (Product) (push) Has been skipped
Monorepo Pipeline / 🐳 Build Build-Base (push) Has been skipped
Monorepo Pipeline / 🐳 Build Production Runtime (push) Has been skipped
🏥 Server Maintenance / 🧹 Prune & Clean (push) Failing after 7s
Analytics Mailer / 📊 Send Analytics Reports (push) Successful in 47s
Some checks failed
Monorepo Pipeline / ⚡ Prioritize Release (push) Successful in 2s
Monorepo Pipeline / 🧹 Lint (push) Failing after 1m25s
Monorepo Pipeline / 🧪 Test (push) Successful in 43s
Monorepo Pipeline / 🏗️ Build (push) Successful in 2m8s
Monorepo Pipeline / 🚀 Release (push) Has been skipped
Monorepo Pipeline / 🐳 Build Gatekeeper (Product) (push) Has been skipped
Monorepo Pipeline / 🐳 Build Build-Base (push) Has been skipped
Monorepo Pipeline / 🐳 Build Production Runtime (push) Has been skipped
🏥 Server Maintenance / 🧹 Prune & Clean (push) Failing after 7s
Analytics Mailer / 📊 Send Analytics Reports (push) Successful in 47s
This commit is contained in:
@@ -166,13 +166,17 @@ async function main() {
|
|||||||
if (!SMTP_HOST) {
|
if (!SMTP_HOST) {
|
||||||
throw new Error("SMTP_HOST is missing for live run.");
|
throw new Error("SMTP_HOST is missing for live run.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const recipients = client.clientEmail.split(',').map(e => e.trim()).filter(e => e.length > 0);
|
||||||
|
for (const recipient of recipients) {
|
||||||
await transporter.sendMail({
|
await transporter.sendMail({
|
||||||
from: SMTP_SENDER,
|
from: SMTP_SENDER,
|
||||||
to: client.clientEmail,
|
to: recipient,
|
||||||
subject,
|
subject,
|
||||||
html,
|
html,
|
||||||
});
|
});
|
||||||
console.log(`Successfully sent to ${client.clientEmail}`);
|
console.log(`Successfully sent to ${recipient}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
const errorMsg = e.response?.data || e.message;
|
const errorMsg = e.response?.data || e.message;
|
||||||
|
|||||||
Reference in New Issue
Block a user