mirror of
https://github.com/outline/outline.git
synced 2026-11-22 14:01:41 +03:00
chore: Annotate delayed notifs (#10447)
This commit is contained in:
1 parent
fc6152bd55
commit
a5d065e5ec
1 file changed
+11
-1
@@ -1,6 +1,7 @@
|
||||
import addressparser, { EmailAddress } from "addressparser";
|
||||
import Bull from "bull";
|
||||
import invariant from "invariant";
|
||||
import { subMinutes } from "date-fns";
|
||||
import { Node } from "prosemirror-model";
|
||||
import { randomString } from "@shared/random";
|
||||
import { TeamPreference } from "@shared/types";
|
||||
@@ -143,12 +144,21 @@ export default abstract class BaseEmail<
|
||||
? await Notification.emailReferences(notification)
|
||||
: undefined;
|
||||
|
||||
// Check if notification is considerably delayed and annotate
|
||||
// the subject. This is incase of extended downtime or queue backlogs
|
||||
let subject = this.subject(data);
|
||||
if (notification) {
|
||||
if (notification.createdAt < subMinutes(new Date(), 30)) {
|
||||
subject = `Delayed notification: ${subject}`;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
await mailer.sendMail({
|
||||
to: this.props.to,
|
||||
replyTo: this.replyTo?.(data),
|
||||
from: this.from(data),
|
||||
subject: this.subject(data),
|
||||
subject,
|
||||
messageId,
|
||||
references,
|
||||
previewText: this.preview(data),
|
||||
|
||||
Reference in new issue
Block a user