- Forked from
sparkpost
crate.
Ergonomic API, In most places you can now provide a String
or str
.
// email.add_recipient("[email protected]".into())
// becomes
email.add_recipient("[email protected]");
let body :String = String::form("...");
email.html(&body) // gets copied internally
email.html(body) // body moves ownership, no allocation
Attachment
struct can only be created by Attachment::from_data(...)
.
Attachment can be passed as &Attachment
or by moving to the massage.
- added method to set campaign_id for message
- Transmission initialization now has both global and EU options. No need to provide Url
- Message contents are public only to crate
- Message options now take chrono Utf DateTime as start_time value
- Message can have both substitution data and metadata
- message construction and emailAddress construction changed
- added support for using stored recipients list from the api
- Improved tests and documentation
- fix broken readme
- move example to docs
- Message method names changed
- Message initial support for file attachments
- transmission released as module
TransmissionResponse
is now anEnum
- Expose more data types as
pub
- fixed readme typo
- Options now all defaults to false
- Transaction.send() method signature changed it now return
a
struct TransmissionResponse
in the resultsend(&self, message: &Message) -> Result<TransmissionResponse, ReqError> { ... }
- remove Message::json() method
- Message methods are now non consuming
let mut email = Message::new(EmailAddress::with_name("[email protected]", "Example Company")); email.add_recipient("[email protected]".into()) .set_campaign_id("postman_inline_both_example") .set_subject("SparkPost inline template example") .set_html("<html><body>Here is your inline html, {{first_name or 'you great person'}}!<br></body></html>") .set_text("Here is your plain text, {{first_name or 'you great person'}}!");
- better documentation
- moved to rust stable
Initial release, experimental only works on nightly