pub struct Chorus { /* private fields */ }Expand description
The main Chorus client — high-level API for sending messages.
Implementations§
Source§impl Chorus
impl Chorus
Sourcepub fn builder() -> ChorusBuilder
pub fn builder() -> ChorusBuilder
Creates a new ChorusBuilder to configure the client.
Sourcepub async fn send_sms(
&self,
msg: &SmsMessage,
) -> Result<SendResult, ChorusError>
pub async fn send_sms( &self, msg: &SmsMessage, ) -> Result<SendResult, ChorusError>
Sends an SMS message, applying default_from_sms if the message has no from.
Sourcepub async fn send_email(
&self,
msg: &EmailMessage,
) -> Result<SendResult, ChorusError>
pub async fn send_email( &self, msg: &EmailMessage, ) -> Result<SendResult, ChorusError>
Sends an email message directly through the router.
Sourcepub async fn send_email_template(
&self,
to: &str,
template_slug: &str,
variables: &HashMap<String, String>,
) -> Result<SendResult, ChorusError>
pub async fn send_email_template( &self, to: &str, template_slug: &str, variables: &HashMap<String, String>, ) -> Result<SendResult, ChorusError>
Renders a template by slug and sends the result as an email.
Sourcepub async fn send_otp(
&self,
recipient: &str,
code: &str,
app_name: &str,
) -> Result<SendResult, ChorusError>
pub async fn send_otp( &self, recipient: &str, code: &str, app_name: &str, ) -> Result<SendResult, ChorusError>
Sends a one-time password via waterfall routing (email for @ recipients, SMS for phone numbers).
Auto Trait Implementations§
impl Freeze for Chorus
impl !RefUnwindSafe for Chorus
impl Send for Chorus
impl Sync for Chorus
impl Unpin for Chorus
impl UnsafeUnpin for Chorus
impl !UnwindSafe for Chorus
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