use mailerlite_rs::{data::Data, response::Response, MailerLite}; #[tokio::main] async fn main() { let api_key: String = String::from("Your MailerLite API Key"); let mailerlite: MailerLite = MailerLite::new(api_key); let data: Data = Data::new() .add("name", "Regular Campaign") .add("type", "regular") .add("emails[0][subject]", "Test Subject") .add("emails[0][from_name]", "John Doe") .add("emails[0][from]", "john@gmail.com"); let response: Response = mailerlite.campaign().create(data.clone()).await; println!("{:#?}", response); }