smbcloud-email-sdk 0.6.0

Rust client for the smbCloud transactional email API — send email from a verified domain and read delivery status.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use thiserror::Error;

#[derive(Debug, Error)]
pub enum EmailError {
    /// The HTTP layer failed before we got a response — network down, DNS
    /// failure, TLS handshake, that sort of thing.
    #[error("request failed: {0}")]
    Http(#[from] reqwest::Error),

    /// The API replied with a non-2xx status. `message` is whatever the server
    /// put in the response body (typically `{ "message": "..." }`), or the HTTP
    /// reason phrase if the body wasn't readable.
    #[error("email API error {status}: {message}")]
    Api { status: u16, message: String },
}