Skip to content

Commit

Permalink
Release 0.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoniosBarotsis committed Aug 13, 2024
1 parent 7ccf3a4 commit e948c46
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,17 @@ and this project adheres to

<!-- ## [Unreleased] -->

## [0.9.1] - 2024-08-13

### Changed

- renamed `CreateEmailBaseOptions::with_scheduled` to `with_scheduled_at`
- renamed `emails::cancel_schedule` to `cancel`

## [0.9.0] - 2024-08-12

Yanked due to some method naming, use `0.9.1` instead.

### Added

- `email.scheduled_at` field (and `emails::with_scheduled` method for setting it)
Expand Down Expand Up @@ -155,6 +164,7 @@ Disabled `reqwest`'s default features and enabled `rustls-tls`.

Initial release.

[0.9.1]: https://crates.io/crates/resend-rs/0.9.1
[0.9.0]: https://crates.io/crates/resend-rs/0.9.0
[0.8.1]: https://crates.io/crates/resend-rs/0.8.1
[0.8.0]: https://crates.io/crates/resend-rs/0.8.0
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[package]
name = "resend-rs"
version = "0.9.0"
version = "0.9.1"
edition = "2021"

license = "MIT"
Expand Down
8 changes: 4 additions & 4 deletions src/emails.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl EmailsSvc {
///
/// <https://resend.com/docs/api-reference/emails/cancel-email>
#[maybe_async::maybe_async]
pub async fn cancel_schedule(&self, email_id: &str) -> Result<CancelScheduleResponse> {
pub async fn cancel(&self, email_id: &str) -> Result<CancelScheduleResponse> {
let path = format!("/emails/{email_id}/cancel");

let request = self.0.build(Method::POST, &path);
Expand Down Expand Up @@ -263,7 +263,7 @@ pub mod types {

/// Schedule email to be sent later. The date should be in ISO 8601 format
/// (e.g: `2024-08-05T11:52:01.858Z`).
pub fn with_scheduled(mut self, scheduled_at: &str) -> Self {
pub fn with_scheduled_at(mut self, scheduled_at: &str) -> Self {
self.scheduled_at = Some(scheduled_at.to_owned());
self
}
Expand Down Expand Up @@ -598,7 +598,7 @@ mod test {
// Create
let email = CreateEmailBaseOptions::new(from, to, subject)
.with_text("Hello World!")
.with_scheduled(&now_plus_1h);
.with_scheduled_at(&now_plus_1h);
let email = resend.emails.send(email).await?;
std::thread::sleep(std::time::Duration::from_secs(1));

Expand Down Expand Up @@ -632,7 +632,7 @@ mod test {
assert_eq!(time_delta, 2.hour());

// Cancel
let _cancelled = resend.emails.cancel_schedule(&email.id).await?;
let _cancelled = resend.emails.cancel(&email.id).await?;

// Get again, make sure it was cancelled
let email = resend.emails.get(&email.id).await?;
Expand Down

0 comments on commit e948c46

Please sign in to comment.