feat: include bounce reason in export (#226)

This commit is contained in:
KM Koushik
2025-09-11 07:09:13 +10:00
committed by GitHub
parent 0167d13ce8
commit 5423013b77
2 changed files with 140 additions and 21 deletions
@@ -122,9 +122,27 @@ export default function EmailsList() {
return /[",\r\n]/.test(safe) ? `"${safe}"` : safe;
};
const header = ["To", "Status", "Subject", "Sent At"].join(",");
const header = [
"To",
"Status",
"Subject",
"Sent At",
"Bounce Type",
"Bounce Subtype",
"Bounce Reason",
].join(",");
const rows = resp.data.map((e) =>
[e.to, e.status, e.subject, e.sentAt].map(escape).join(","),
[
e.to,
e.status,
e.subject,
e.sentAt,
e.bounceType,
e.bounceSubType,
e.bounceReason,
]
.map(escape)
.join(","),
);
const csv = [header, ...rows].join("\n");