Skip to content

Commit b750ebf

Browse files
authored
feat: suppress email adapter warning on build (#7129)
Email adapter warnings are triggered on production builds. The `NEXT_PHASE` env var is now evaluated before logging this warning.
1 parent 31b7a70 commit b750ebf

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

packages/payload/src/index.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -542,9 +542,11 @@ export class BasePayload {
542542
} else if (this.config.email) {
543543
this.email = this.config.email({ payload: this })
544544
} else {
545-
this.logger.warn(
546-
`No email adapter provided. Email will be written to console. More info at https://payloadcms.com/docs/email/overview.`,
547-
)
545+
if (process.env.NEXT_PHASE !== 'phase-production-build') {
546+
this.logger.warn(
547+
`No email adapter provided. Email will be written to console. More info at https://payloadcms.com/docs/email/overview.`,
548+
)
549+
}
548550

549551
this.email = consoleEmailAdapter({ payload: this })
550552
}

0 commit comments

Comments
 (0)