diff --git a/core/notifications/notifications.yml b/core/notifications/notifications.yml index e2984afc53..ca556e3b7e 100644 --- a/core/notifications/notifications.yml +++ b/core/notifications/notifications.yml @@ -9,11 +9,11 @@ app: push_executor: fcm: google_application_credentials_path: "./config/notifications/fake_service_account.json" - email_executor: - smtp: - username: "" - from_email: "" - relay: "" - port: 587 + # email_executor: + # smtp: + # username: "" + # from_email: "" + # relay: "" + # port: 587 # kratos_import: # execute_import: true diff --git a/core/notifications/src/app/config.rs b/core/notifications/src/app/config.rs index 39d3165f3e..4f104bf790 100644 --- a/core/notifications/src/app/config.rs +++ b/core/notifications/src/app/config.rs @@ -5,5 +5,6 @@ use crate::{email_executor::EmailExecutorConfig, push_executor::PushExecutorConf #[derive(Clone, Default, Serialize, Deserialize)] pub struct AppConfig { pub push_executor: PushExecutorConfig, + #[serde(default)] pub email_executor: EmailExecutorConfig, } diff --git a/core/notifications/src/email_executor/config.rs b/core/notifications/src/email_executor/config.rs index b8c32e73bc..e66ad51e2d 100644 --- a/core/notifications/src/email_executor/config.rs +++ b/core/notifications/src/email_executor/config.rs @@ -4,5 +4,6 @@ use super::smtp::SmtpConfig; #[derive(Clone, Default, Debug, Deserialize, Serialize)] pub struct EmailExecutorConfig { + #[serde(default)] pub smtp: SmtpConfig, } diff --git a/core/notifications/src/email_executor/smtp/config.rs b/core/notifications/src/email_executor/smtp/config.rs index be5e0cddde..a5040fb3d5 100644 --- a/core/notifications/src/email_executor/smtp/config.rs +++ b/core/notifications/src/email_executor/smtp/config.rs @@ -2,10 +2,18 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, Deserialize, Serialize)] pub struct SmtpConfig { + #[serde(default)] pub username: String, #[serde(default)] pub password: String, + #[serde(default)] pub from_email: String, + #[serde(default)] pub relay: String, + #[serde(default = "default_smtp_port")] pub port: u16, } + +fn default_smtp_port() -> u16 { + 587 +}