Skip to main content

Crate sentd

Crate sentd 

Source
Expand description

§SENTD Rust SDK

Official Rust client for the SENTD Email API.

§Quick Start

use sentd::{Sentd, SendEmailRequest};

#[tokio::main]
async fn main() -> Result<(), sentd::Error> {
    let client = Sentd::new("your_api_key");

    let result = client.emails().send(SendEmailRequest {
        from: "hello@yourdomain.com".to_string(),
        to: vec!["user@example.com".to_string()],
        subject: "Welcome!".to_string(),
        html: Some("<h1>Hello World</h1>".to_string()),
        ..Default::default()
    }).await?;

    println!("Email sent! ID: {}", result.data.id);
    Ok(())
}

Re-exports§

pub use client::Sentd;
pub use error::Error;
pub use types::*;

Modules§

analytics
batch
client
domains
emails
error
templates
types
webhooks