pub async fn email_client_settings(&self) -> anyhow::Result<Option<EmailClientSettings>> {
        let disable_local = crate::env::env_bool(keys::email::DISABLE);

        if disable_local && self.remote_target == RemoteTarget::Local {
            return Ok(None);
        }

        let api_key = self.get_varying_secret(keys::email::API_KEY).await?;

        let sender_email = self.get_varying_secret(keys::email::SENDER_EMAIL).await?;

        let signup_verify_template = self
            .get_varying_secret(keys::email::SIGNUP_VERIFY_TEMPLATE)
            .await?;

        let password_reset_template = self
            .get_varying_secret(keys::email::PASSWORD_RESET_TEMPLATE)
            .await?;

        let (api_key, sender_email) = match (api_key, sender_email) {
            (Some(api_key), Some(sender_email)) => (api_key, sender_email),
            _ => return Ok(None),
        };

        Ok(Some(EmailClientSettings {
            api_key,
            sender_email,
            signup_verify_template,
            password_reset_template,
        }))
    }
/// Load the Email Client settings.
Load the Email Client settings.
Load the Email Client settings .
pub async fn email_client_settings(&self) -> anyhow::Result<Option<EmailClientSettings>> {
        let disable_local = crate::env::env_bool(keys::email::DISABLE);
        if disable_local && self.remote_target == RemoteTarget::Local {
            return Ok(None);
        }
        let api_key = self.get_varying_secret(keys::email::API_KEY).await?;
        let sender_email = self.get_varying_secret(keys::email::SENDER_EMAIL).await?;
        let signup_verify_template = self
            .get_varying_secret(keys::email::SIGNUP_VERIFY_TEMPLATE)
            .await?;
        let password_reset_template = self
            .get_varying_secret(keys::email::PASSWORD_RESET_TEMPLATE)
            .await?;
        let (api_key, sender_email) = match (api_key, sender_email) {
            (Some(api_key), Some(sender_email)) => (api_key, sender_email),
            _ => return Ok(None),
        };
        Ok(Some(EmailClientSettings {
            api_key,
            sender_email,
            signup_verify_template,
            password_reset_template,
        }))
    }
pub async fn email_client_settings ( & self ) -> anyhow :: Result < Option < EmailClientSettings > > { let disable_local = crate :: env :: env_bool ( keys :: email :: DISABLE ) ; if disable_local && self . remote_target == RemoteTarget :: Local { return Ok ( None ) ; } let api_key = self . get_varying_secret ( keys :: email :: API_KEY ) . await ? ; let sender_email = self . get_varying_secret ( keys :: email :: SENDER_EMAIL ) . await ? ; let signup_verify_template = self . get_varying_secret ( keys :: email :: SIGNUP_VERIFY_TEMPLATE ) . await ? ; let password_reset_template = self . get_varying_secret ( keys :: email :: PASSWORD_RESET_TEMPLATE ) . await ? ; let ( api_key , sender_email ) = match ( api_key , sender_email ) { ( Some ( api_key ) , Some ( sender_email ) ) => ( api_key , sender_email ) , _ => return Ok ( None ) , } ; Ok ( Some ( EmailClientSettings { api_key , sender_email , signup_verify_template , password_reset_template , } ) ) }
Load the Email Client settings.
Load the Email Client settings .
&self
&self