Skip to content

Commit

Permalink
mail
Browse files Browse the repository at this point in the history
  • Loading branch information
sinamics committed Aug 28, 2024
1 parent 58c125c commit 34731f4
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/utils/mail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,6 @@ export const mailTemplateMap = {
deviceIpChangeNotificationTemplate,
} as const;

const templateToOptionMap: Record<string, string> = {
newDeviceNotificationTemplate: "newDeviceNotification",
deviceIpChangeNotificationTemplate: "deviceIpChangeNotification",
};

interface EmailTemplate {
subject: string;
body: string;
Expand Down Expand Up @@ -171,6 +166,15 @@ export async function sendMailWithTemplate(
await sendEmail(transporter, mailOptions);
}

/**
* Check if the user has disabled notifications for the given template
*
*/
const templateToOptionMap: Record<string, string> = {
newDeviceNotificationTemplate: "newDeviceNotification",
deviceIpChangeNotificationTemplate: "deviceIpChangeNotification",
};

async function checkUserPreferences(
userId: string,
templateKey: MailTemplateKey,
Expand Down

0 comments on commit 34731f4

Please sign in to comment.