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.
emailmaps toemail_addresson the wire. - Address
- A recipient or sender address. A bare string is sugar for
{ email }. - Attachment
- A file attachment.
content_base64is raw base64 with nodata:prefix. - Axene
- Axene Mailer API client.
- Axene
Builder - Builder for
Axene. Construct withAxene::builder. - Axene
Error - Raised for any non-2xx API response, or for a transport failure that survives all retries.
- Batch
Item Result - One per-message result inside a batch response.
- Batch
Response - Result of a batch send.
- Bulk
Send - Body for a templated bulk send.
contact_list_idis injected by the SDK. - Bulk
Send Result - Result of a bulk send.
- Bulk
Suppression Result - Result of a bulk suppression upload.
- Contact
- A single contact in a list.
- Contact
List - A subscriber list.
- Contact
List Detail - A contact list with a page of its contacts.
- Contacts
- Accessed as
client.contacts(). - Create
List - Body for creating a contact list. Build with
CreateList::new. - Create
Template - Body for creating a template.
html/textmap tohtml_body/text_body. - Create
Webhook - Body for creating a webhook.
- CsvImport
Result - Result of a CSV contact import.
- Dkim
Rotation - 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.
- Domain
Availability - Result of a domain availability check.
- Domain
Check - Result of a domain existence check.
- Domain
Diagnosis - Result of a domain diagnosis.
issuesshapes vary; treated as opaque. - Domain
Health - Result of a domain health report.
- Domain
Health Check - One row of a domain health report.
- Domain
Health Summary - Tally of health-check outcomes.
- Domain
List Item - A row from the domain list: a sending domain and its status.
- Domain
Transfer - A domain transfer record.
- Domains
- Accessed as
client.domains(). - A stored email and its current status.
- Email
Detail - A stored email with its bodies and events.
- Email
Event - A delivery / open / click / bounce event for a message.
- Email
Search Hit - 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 }. - Scheduled
Email - A scheduled email awaiting send.
- Send
Email - Body of a send / validate request.
- Send
Email Builder - Ergonomic builder for
SendEmail. - Send
Email Response - 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.
variablesis server-derived and read-only. - Templates
- Accessed as
client.templates(). - Transfer
Domain - Body for initiating a domain transfer.
- Update
List - Partial body for updating a contact list. Defaults to all-unset.
- Update
Template - Partial body for updating a template. Defaults to all-unset.
- Update
Webhook - Partial body for updating a webhook.
is_activehonours the wire name. - Validation
Issue - A single reason a message would not send.
- Validation
Result - Result of a dry-run validation.
- Validation
Usage - Sending-quota usage returned alongside a validation.
- Webhook
- A configured webhook endpoint.
secretis returned in plaintext. - Webhook
Delivery - A summary of one webhook delivery attempt.
- Webhook
Delivery Detail - A webhook delivery with the full payload and endpoint response.
- Webhook
Test Result - Result of testing a webhook endpoint.
- Webhooks
- Accessed as
client.webhooks().
Traits§
- Into
Address List - Conversion trait so
to/cc/bccaccept a single address or a list.
Type Aliases§
- Result
- Convenience alias for results returned by the SDK.