1 //! Rust client for the smbCloud transactional email API.
2 //!
3 //! Send transactional email from your verified domain and read each message's
4 //! delivery status. This crate handles the HTTP transport and the
5 //! `Authorization: Bearer <api_key>` header; you build the message and own the
6 //! content.
7 //!
8 //! # Quick start
9 //!
10 //! ```no_run
11 //! use smbcloud_email_sdk::{EmailClient, EmailCredentials, Environment, SendEmail};
12 //!
13 //! #[tokio::main]
14 //! async fn main() -> anyhow::Result<()> {
15 //! let client = EmailClient::from_credentials(
16 //! Environment::Production,
17 //! EmailCredentials { api_key: "smb_mail_your_key" },
18 //! );
19 //!
20 //! let message = SendEmail::new("billing@example.com", ["customer@acme.com"])
21 //! .subject("Your receipt")
22 //! .html("<h1>Thanks!</h1>")
23 //! .text("Thanks!")
24 //! .idempotency_key("receipt-2026-0001");
25 //!
26 //! let sent = client.send(&message).await?;
27 //! println!("sent {} ({:?})", sent.id, sent.status);
28 //!
29 //! Ok(())
30 //! }
31 //! ```
32
33 mod client;
34 mod client_credentials;
35 mod error;
36 mod message;
37
38 pub use client::EmailClient;
39 pub use client_credentials::{base_url, EmailCredentials};
40 pub use error::EmailError;
41 pub use message::{Attachment, EmailEvent, EmailMessage, EmailStatus, SendEmail};
42 pub use smbcloud_network::environment::Environment;