Skip to content

Commit

Permalink
ses genocide
Browse files Browse the repository at this point in the history
  • Loading branch information
aletya committed Jul 16, 2024
1 parent c6a9d16 commit 9a4077a
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 82 deletions.
2 changes: 0 additions & 2 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import eventsRouter from "./services/events/events-router";
import notificationsRouter from "./services/notifications/notifications-router";
import registrationRouter from "./services/registration/registration-router";
import s3Router from "./services/s3/s3-router";
import sesRouter from "./services/ses/ses-router";
import statsRouter from "./services/stats/stats-router";
import sponsorRouter from "./services/sponsor/sponsor-router";
import subscriptionRouter from "./services/subscription/subscription-router";
Expand Down Expand Up @@ -50,7 +49,6 @@ app.use("/events", databaseMiddleware, eventsRouter);
app.use("/notifications", databaseMiddleware, notificationsRouter);
app.use("/registration", databaseMiddleware, registrationRouter);
app.use("/s3", databaseMiddleware, s3Router);
app.use("/ses", sesRouter);
app.use("/stats", databaseMiddleware, statsRouter);
app.use("/sponsor", databaseMiddleware, sponsorRouter);
app.use("/subscription", databaseMiddleware, subscriptionRouter);
Expand Down
2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const Config = {
QR_HASH_ITERATIONS: 10000,
QR_HASH_SECRET: getEnv("QR_HASH_SECRET"),

OUTGOING_EMAIL_ADDRESSES: "[email protected]",
OUTGOING_EMAIL_ADDRESSES: z.enum(["[email protected]"]),
};

export const DeviceRedirects: Record<string, string> = {
Expand Down
16 changes: 0 additions & 16 deletions src/services/ses/ses-formats.ts

This file was deleted.

52 changes: 0 additions & 52 deletions src/services/ses/ses-router.ts

This file was deleted.

10 changes: 0 additions & 10 deletions src/services/ses/ses-schema.ts

This file was deleted.

16 changes: 15 additions & 1 deletion src/services/ses/ses-utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
import { ses, Config } from "../../config";

export function sendManyEmails(
emailIds: string[],
subject: string,
emailBody: string
): Promise<AWS.SES.SendEmailResponse>[] {
const emailPromises: Promise<AWS.SES.SendEmailResponse>[] = [];
for (let i = 0; i < emailIds.length; i++) {
emailPromises.push(sendEmail(emailIds[i], subject, emailBody));
}
return emailPromises;
}

export function sendEmail(
emailId: string,
subject: string,
Expand All @@ -20,7 +32,9 @@ export function sendEmail(
Data: subject,
},
},
Source: Config.OUTGOING_EMAIL_ADDRESSES,
Source: Config.OUTGOING_EMAIL_ADDRESSES.Enum[
"[email protected]"
],
})
.promise();
}

0 comments on commit 9a4077a

Please sign in to comment.