Skip to content

Commit c2d83dd

Browse files
committed
fix
1 parent ec19f74 commit c2d83dd

3 files changed

Lines changed: 15 additions & 2 deletions

File tree

apps/web/src/app/(dashboard)/emails/email-details.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,13 @@ const EmailStatusText = ({
268268
);
269269
} else if (status === "CANCELLED") {
270270
return <div>This scheduled email was cancelled</div>;
271+
} else if (status === "SUPPRESSED") {
272+
return (
273+
<div>
274+
This email was suppressed because this email is previously either
275+
bounced or the recipient complained.
276+
</div>
277+
);
271278
}
272279

273280
return <div className="w-full">{status}</div>;

apps/web/src/app/(dashboard)/emails/email-list.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ export default function EmailsList() {
173173
"OPENED",
174174
"DELIVERY_DELAYED",
175175
"COMPLAINED",
176+
"SUPPRESSED",
176177
]).map((status) => (
177178
<SelectItem key={status} value={status} className=" capitalize">
178179
{status.toLowerCase().replace("_", " ")}

apps/web/src/server/service/email-service.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,13 @@ export async function sendEmail(
7575
// Check for suppressed emails before sending
7676
const emailsToCheck = Array.isArray(to) ? to : [to];
7777

78+
const suppressionResults = await SuppressionService.checkMultipleEmails(
79+
emailsToCheck,
80+
teamId
81+
);
82+
7883
const filteredToEmails = emailsToCheck.filter(
79-
(email) => !SuppressionService.isEmailSuppressed(email, teamId)
84+
(email) => !suppressionResults[email]
8085
);
8186

8287
if (filteredToEmails.length === 0) {
@@ -113,7 +118,7 @@ export async function sendEmail(
113118
},
114119
});
115120

116-
return;
121+
return email;
117122
}
118123

119124
if (templateId) {

0 commit comments

Comments
 (0)