Skip to content

Commit a75df38

Browse files
committed
feat(email): restrict new document notification to production environment
1 parent 0fa5f9d commit a75df38

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

  • packages/hocuspocus.server/src/lib

packages/hocuspocus.server/src/lib/email.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,16 @@ export const sendEmail = async (params: SendEmailParams): Promise<boolean> => {
6666

6767
/**
6868
* Sends notification email when a new document is created
69+
* Only sends in production environment to avoid noise during development
6970
*/
7071
export const sendNewDocumentNotification = async (
7172
params: NewDocumentEmailParams
7273
): Promise<boolean> => {
74+
if (process.env.NODE_ENV !== 'production') {
75+
emailLogger.debug('Skipping new document notification (non-production environment)')
76+
return false
77+
}
78+
7379
const notificationEmails = process.env.NEW_DOCUMENT_NOTIFICATION_EMAILS
7480

7581
if (!notificationEmails) {

0 commit comments

Comments
 (0)