Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🪵 Notifications necessary log #267

Merged
merged 2 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ export default class EmailPusherClass
{ subject, html: html_body, text: text_body }: EmailPusherPayload,
): Promise<void> {
try {
this.logger.info("sending email");
if (!html_body || !text_body || !subject || !to) {
this.logger.error("invalid email");
throw Error("invalid email");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export class DocumentsEngine implements Initializable {
],
},
);
logger.info(`Sending email notification to ${receiver.email_canonical}`);
await globalResolver.platformServices.emailPusher.send(receiver.email_canonical, {
subject,
html,
Expand Down
7 changes: 7 additions & 0 deletions tdrive/backend/node/src/services/documents/services/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,9 @@ export class DocumentsService {

if (sharedWith.length > 0) {
// Notify the user that the document has been shared with them
this.logger.info("Notifying user that the document has been shared with them: ", {
sharedWith,
});
gr.services.documents.engine.notifyDocumentShared({
context,
item,
Expand Down Expand Up @@ -733,6 +736,10 @@ export class DocumentsService {
await this.repository.save(item);

// Notify the user that the document versions have been updated
this.logger.info("Notifying user that the document has been updated: ", {
item,
notificationEmitter: context.user.id,
});
gr.services.documents.engine.notifyDocumentVersionUpdated({
context,
item,
Expand Down
Loading