SendWithUs Rust Client
An async Rust client for the SendWithUs API.
Features
- Full async support with Tokio
- Type-safe API
- Comprehensive error handling
- Support for all SendWithUs API endpoints
- Simple and ergonomic interface
- File attachment support
- Optional logging support via tracing
Installation
Add this to your Cargo.toml
:
[]
= "0.1.0"
# With optional logging feature enabled
= { = "0.1.0", = ["logging"] }
Usage
Basic Example
use ;
use ;
use HashMap;
use json;
async
With Email Attachments
use ;
use ;
async
Custom Configuration
use ;
async
API Documentation
The client provides methods for all SendWithUs API endpoints:
send_email
- Send a templated emaillist_templates
- List all templatesrender
- Render a template with datacreate_template
- Create a new templatelist_drip_campaigns
- List all drip campaignsstart_on_drip_campaign
- Start a recipient on a drip campaignremove_from_drip_campaign
- Remove a recipient from a drip campaign- And many more...
See the API documentation for complete details.
Logging
This library provides optional logging integration via the tracing
crate. To enable it, add the logging
feature to your dependency:
[]
= { = "0.1.0", = ["logging"] }
When the logging
feature is enabled, the library will log API operations, request details, and responses at appropriate trace levels. This can be helpful for debugging and monitoring API usage.
For development and testing, the tracing crate is included as a dev-dependency, allowing example code to use it without requiring it for production usage.
License
This project is licensed under the MIT License - see the LICENSE file for details.