From c5141c77976cd17e5e457ac0d1fb6647636056bb Mon Sep 17 00:00:00 2001 From: Raphael Kabo Date: Mon, 1 Jul 2024 19:50:25 +0100 Subject: [PATCH] Allow 'none' as an email option --- config/config.example.toml | 2 +- src/lib/config.ts | 4 ++-- src/lib/email.ts | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/config/config.example.toml b/config/config.example.toml index 5502038..d58fe35 100644 --- a/config/config.example.toml +++ b/config/config.example.toml @@ -22,7 +22,7 @@ show_public_event_list = false # Which mail service to use to send emails to hosts and attendees. Options are # 'nodemailer' or 'sendgrid'. Configure settings for this mail # service below. -mail_service = "nodemailer" +mail_service = "none" # An array of email addresses which are permitted to create events. If this is # empty, anyone can create events. # For example: diff --git a/src/lib/config.ts b/src/lib/config.ts index b4086d8..e8b774a 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -21,7 +21,7 @@ export interface GathioConfig { email_logo_url: string; show_kofi: boolean; show_public_event_list: boolean; - mail_service: "nodemailer" | "sendgrid"; + mail_service: "nodemailer" | "sendgrid" | "none"; creator_email_addresses: string[]; }; database: { @@ -62,7 +62,7 @@ const defaultConfig: GathioConfig = { email_logo_url: "", show_public_event_list: false, show_kofi: false, - mail_service: "nodemailer", + mail_service: "none", creator_email_addresses: [], }, database: { diff --git a/src/lib/email.ts b/src/lib/email.ts index 9b8162b..3cf3156 100644 --- a/src/lib/email.ts +++ b/src/lib/email.ts @@ -66,6 +66,7 @@ export const initEmailService = async (): Promise => { "Error verifying Nodemailer transporter. Please check your Nodemailer configuration.", ); } + case "none": default: console.warn( "You have not configured this Gathio instance to send emails! This means that event creators will not receive emails when their events are created, which means they may end up locked out of editing events. Consider setting up an email service.",