pub struct NotificationConfig {
pub mail: Option<MailConfig>,
pub slack_webhook: Option<String>,
}Expand description
Configuration for the notification dispatcher.
Fields§
§mail: Option<MailConfig>Mail configuration (supports SMTP and Resend drivers).
slack_webhook: Option<String>Slack webhook URL.
Implementations§
Source§impl NotificationConfig
impl NotificationConfig
Sourcepub fn from_env() -> Self
pub fn from_env() -> Self
Create configuration from environment variables.
Reads the following environment variables:
- Mail:
MAIL_HOST,MAIL_PORT,MAIL_USERNAME,MAIL_PASSWORD,MAIL_FROM_ADDRESS,MAIL_FROM_NAME,MAIL_ENCRYPTION - Slack:
SLACK_WEBHOOK_URL
§Example
ⓘ
use ferro_notifications::NotificationConfig;
// In bootstrap.rs
let config = NotificationConfig::from_env();
NotificationDispatcher::configure(config);Sourcepub fn mail(self, config: MailConfig) -> Self
pub fn mail(self, config: MailConfig) -> Self
Set the mail configuration.
Sourcepub fn slack_webhook(self, url: impl Into<String>) -> Self
pub fn slack_webhook(self, url: impl Into<String>) -> Self
Set the Slack webhook URL.
Trait Implementations§
Source§impl Clone for NotificationConfig
impl Clone for NotificationConfig
Source§fn clone(&self) -> NotificationConfig
fn clone(&self) -> NotificationConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for NotificationConfig
impl Default for NotificationConfig
Source§fn default() -> NotificationConfig
fn default() -> NotificationConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for NotificationConfig
impl RefUnwindSafe for NotificationConfig
impl Send for NotificationConfig
impl Sync for NotificationConfig
impl Unpin for NotificationConfig
impl UnsafeUnpin for NotificationConfig
impl UnwindSafe for NotificationConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more