Skip to main content

Crate resent

Crate resent 

Source
Expand description

Official Rust SDK for Resent transactional email.

use resent::{Resent, SendEmail};

let resent = Resent::new(std::env::var("RESENT_API_KEY").unwrap());

let result = resent
    .emails()
    .send(SendEmail {
        from: "Acme <noreply@yourdomain.com>".into(),
        to: vec!["you@example.com".into()],
        subject: "Hello World".into(),
        html: Some("<strong>It works!</strong>".into()),
        ..Default::default()
    })
    .await?;

println!("{:?}", result.submission_id);

Structs§

Emails
Email API namespace (resent.emails()).
Resent
Official Resent API client.
SendEmail
Request body for POST /email/send.
SendEmailResponse
Successful send response.

Enums§

Error
Errors returned by the Resent client.