pub struct Mail { /* private fields */ }Expand description
Plugin installer — call Self::client before app.install to share the handle (e.g. tasks).
Implementations§
Source§impl Mail
impl Mail
Sourcepub fn smtp(host: impl Into<String>) -> SmtpBuilder
pub fn smtp(host: impl Into<String>) -> SmtpBuilder
SMTP relay (STARTTLS via lettre relay). Use SmtpBuilder::build or install via From.
Sourcepub fn from_env() -> Self
pub fn from_env() -> Self
Like Self::try_from_env, panics on invalid SMTP URL / unknown mailer.
Missing mailer + missing URL still yields fake (dev DX). Prefer
Self::try_from_env in main when you want ?.
Sourcepub fn try_from_env() -> Result<Self>
pub fn try_from_env() -> Result<Self>
Build from process env — see Self::try_from_vars.
Sourcepub fn try_from_vars<F>(get: F) -> Result<Self>
pub fn try_from_vars<F>(get: F) -> Result<Self>
Build from a lookup fn (tests / custom env sources).
SOVA_MAIL/SOVA_MAIL_MAILER:fake|smtp|file(optional)- No mailer + no URL →
Self::fake(dev) smtp/ URL set + parse failure →Err(never silently fakes)file→SOVA_MAIL_PATH(default./mail)
pub fn from(self, addr: impl Into<String>) -> Self
Sourcepub fn client(&self) -> MailClient
pub fn client(&self) -> MailClient
Shared client (clone before install for background jobs).
With feature templates, the templates slot is shared with the installed
client — wiring at install / startup reaches earlier clones too.
Sourcepub fn recorder(&self) -> Option<&FakeMail>
pub fn recorder(&self) -> Option<&FakeMail>
Recorder when using Self::fake.
Trait Implementations§
Source§impl From<SmtpBuilder> for Mail
impl From<SmtpBuilder> for Mail
Source§fn from(b: SmtpBuilder) -> Self
fn from(b: SmtpBuilder) -> Self
Converts to this type from the input type.
Source§impl Plugin for Mail
impl Plugin for Mail
Source§fn id(&self) -> &'static str
fn id(&self) -> &'static str
Stable plugin identifier used for dependency checks and
crate::App::has_plugin. Read moreSource§fn meta(&self) -> PluginMeta
fn meta(&self) -> PluginMeta
Display name, description, and declared
PluginMeta::sdk version.Auto Trait Implementations§
impl !RefUnwindSafe for Mail
impl !UnwindSafe for Mail
impl Freeze for Mail
impl Send for Mail
impl Sync for Mail
impl Unpin for Mail
impl UnsafeUnpin for Mail
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