Skip to main content

Crate axene_mailer

Crate axene_mailer 

Source
Expand description

Async Rust SDK for the Axene Mailer API.

Send transactional and bulk email, manage sending domains, subscriber lists, suppressions, templates, and webhooks. Built on reqwest + serde, with a single transport layer that owns bearer auth, JSON, retries on 429/5xx (honouring Retry-After), and error mapping to AxeneError.

§Quickstart

use axene_mailer::{Axene, SendEmail};

#[tokio::main]
async fn main() -> Result<(), axene_mailer::AxeneError> {
    let client = Axene::new(std::env::var("AXENE_API_KEY").unwrap())?;

    let message = SendEmail::builder(
        ("hello@yourdomain.com", "Your Company"),
        "customer@example.com",
        "Your receipt",
    )
    .html("<p>Thanks for your order.</p>")
    .build();

    let res = client.emails().send(&message).await?;
    println!("queued message {}", res.id);
    Ok(())
}

Resources are reached through accessor methods: Axene::emails, Axene::domains, Axene::contacts, Axene::suppressions, Axene::templates, and Axene::webhooks.

Structs§

AddContact
Body for adding a contact to a list.
AddSuppression
Body for adding a suppression. email maps to email_address on the wire.
Address
A recipient or sender address. A bare string is sugar for { email }.
Attachment
A file attachment. content_base64 is raw base64 with no data: prefix.
Axene
Axene Mailer API client.
AxeneBuilder
Builder for Axene. Construct with Axene::builder.
AxeneError
Raised for any non-2xx API response, or for a transport failure that survives all retries.
BatchItemResult
One per-message result inside a batch response.
BatchResponse
Result of a batch send.
BulkSend
Body for a templated bulk send. contact_list_id is injected by the SDK.
BulkSendResult
Result of a bulk send.
BulkSuppressionResult
Result of a bulk suppression upload.
Contact
A single contact in a list.
ContactList
A subscriber list.
ContactListDetail
A contact list with a page of its contacts.
Contacts
Accessed as client.contacts().
CreateList
Body for creating a contact list. Build with CreateList::new.
CreateTemplate
Body for creating a template. html/text map to html_body/text_body.
CreateWebhook
Body for creating a webhook.
CsvImportResult
Result of a CSV contact import.
DkimRotation
Result of a DKIM rotation: the new record plus the updated domain.
DnsRecord
A DNS record the API expects you to publish for a domain.
Domain
A sending domain with its DKIM selector and DNS records.
DomainAvailability
Result of a domain availability check.
DomainCheck
Result of a domain existence check.
DomainDiagnosis
Result of a domain diagnosis. issues shapes vary; treated as opaque.
DomainHealth
Result of a domain health report.
DomainHealthCheck
One row of a domain health report.
DomainHealthSummary
Tally of health-check outcomes.
DomainListItem
A row from the domain list: a sending domain and its status.
DomainTransfer
A domain transfer record.
Domains
Accessed as client.domains().
Email
A stored email and its current status.
EmailDetail
A stored email with its bodies and events.
EmailEvent
A delivery / open / click / bounce event for a message.
EmailSearchHit
A search hit from the email search endpoint.
Emails
Accessed as client.emails().
IdStatus
A simple { id, status } response (cancel / send-now).
Page
A paginated envelope { items, total, page, limit }.
ScheduledEmail
A scheduled email awaiting send.
SendEmail
Body of a send / validate request.
SendEmailBuilder
Ergonomic builder for SendEmail.
SendEmailResponse
Result of a send: the queued message id and its initial status.
Suppression
A suppressed recipient address.
Suppressions
Accessed as client.suppressions().
Template
A reusable email template. variables is server-derived and read-only.
Templates
Accessed as client.templates().
TransferDomain
Body for initiating a domain transfer.
UpdateList
Partial body for updating a contact list. Defaults to all-unset.
UpdateTemplate
Partial body for updating a template. Defaults to all-unset.
UpdateWebhook
Partial body for updating a webhook. is_active honours the wire name.
ValidationIssue
A single reason a message would not send.
ValidationResult
Result of a dry-run validation.
ValidationUsage
Sending-quota usage returned alongside a validation.
Webhook
A configured webhook endpoint. secret is returned in plaintext.
WebhookDelivery
A summary of one webhook delivery attempt.
WebhookDeliveryDetail
A webhook delivery with the full payload and endpoint response.
WebhookTestResult
Result of testing a webhook endpoint.
Webhooks
Accessed as client.webhooks().

Traits§

IntoAddressList
Conversion trait so to/cc/bcc accept a single address or a list.

Type Aliases§

Result
Convenience alias for results returned by the SDK.