Skip to content

Commit b595a0d

Browse files
committed
fix: No-op sending emails in self-hosted if configuration is unavailable rather than retrying
towards outline#7982
1 parent 1c86119 commit b595a0d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

server/emails/templates/BaseEmail.tsx

+9
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,15 @@ export default abstract class BaseEmail<
5151
* @returns A promise that resolves once the email is placed on the task queue
5252
*/
5353
public schedule(options?: Bull.JobOptions) {
54+
// No-op to schedule emails if SMTP is not configured
55+
if (!env.SMTP_FROM_EMAIL) {
56+
Logger.info(
57+
"email",
58+
`Email ${this.constructor.name} not sent due to missing SMTP configuration`
59+
);
60+
return;
61+
}
62+
5463
const templateName = this.constructor.name;
5564

5665
Metrics.increment("email.scheduled", {

0 commit comments

Comments
 (0)