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) {
|
||||
throw new Error("SMTP_HOST is missing for live run.");
|
||||
}
|
||||
await transporter.sendMail({
|
||||
from: SMTP_SENDER,
|
||||
to: client.clientEmail,
|
||||
subject,
|
||||
html,
|
||||
});
|
||||
console.log(`Successfully sent to ${client.clientEmail}`);
|
||||
|
||||
const recipients = client.clientEmail.split(',').map(e => e.trim()).filter(e => e.length > 0);
|
||||
for (const recipient of recipients) {
|
||||
await transporter.sendMail({
|
||||
from: SMTP_SENDER,
|
||||
to: recipient,
|
||||
subject,
|
||||
html,
|
||||
});
|
||||
console.log(`Successfully sent to ${recipient}`);
|
||||
}
|
||||
}
|
||||
} catch (e: any) {
|
||||
const errorMsg = e.response?.data || e.message;
|
||||
|
||||
Reference in New Issue
Block a user