Move in-app notifications to instant, keep emails delayed (#6506)

This commit is contained in:
Tom Moor
2024-02-07 05:05:51 -08:00
committed by GitHub
parent d8e59a32ee
commit 140e685d67
3 changed files with 31 additions and 19 deletions

View File

@@ -92,6 +92,15 @@ export default abstract class BaseEmail<
? await Notification.unscoped().findByPk(this.metadata?.notificationId)
: undefined;
if (notification?.viewedAt) {
Logger.info(
"email",
`Email ${templateName} not sent as already viewed`,
this.props
);
return;
}
try {
await mailer.sendMail({
to: this.props.to,