From 0723b2f0b8fe3c11d91f39a5f0f1bae6a35faed1 Mon Sep 17 00:00:00 2001 From: Lucas Fernandes da Costa Date: Fri, 26 Jun 2026 09:39:40 -0300 Subject: [PATCH 1/2] feat: add received_for to inbound email and received event types Co-Authored-By: Claude Opus 4.8 (1M context) --- src/events.rs | 4 ++++ src/receiving.rs | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/events.rs b/src/events.rs index 1132f57..e5f8815 100644 --- a/src/events.rs +++ b/src/events.rs @@ -376,6 +376,8 @@ pub struct Suppressed { pub struct Received { pub bcc: Vec, pub cc: Vec, + #[serde(default)] + pub received_for: Vec, pub message_id: String, pub attachments: Vec, } @@ -797,6 +799,7 @@ mod test { "to": ["delivered@resend.dev"], "bcc": [], "cc": [], + "received_for": ["forwarded@example.com"], "message_id": "", "subject": "Sending this example", "attachments": [ @@ -824,6 +827,7 @@ mod test { assert!(received.attachments.len() == 1); assert!(received.cc.is_empty()); assert!(received.bcc.is_empty()); + assert_eq!(received.received_for, vec!["forwarded@example.com"]); } else { panic!("Wrong parsing"); } diff --git a/src/receiving.rs b/src/receiving.rs index 9fcc035..1e2159a 100644 --- a/src/receiving.rs +++ b/src/receiving.rs @@ -264,6 +264,8 @@ pub mod types { pub cc: Vec, #[serde(default)] pub reply_to: Vec, + #[serde(default)] + pub received_for: Vec, pub html: Option, pub text: Option, #[serde(default)] @@ -445,6 +447,7 @@ mod test { "bcc": [], "cc": [], "reply_to": [], + "received_for": ["forwarded@example.com"], "message_id": "<111-222-333@email.provider.example.com>", "raw": { "download_url": "https://example.com/emails/raw/abc123?signature=xyz789", @@ -466,6 +469,9 @@ mod test { let res = serde_json::from_str::>(emails); assert!(res.is_ok()); - assert!(res.unwrap().data.first().unwrap().raw.is_some()); + let data = res.unwrap(); + let email = data.data.first().unwrap(); + assert!(email.raw.is_some()); + assert_eq!(email.received_for, vec!["forwarded@example.com"]); } } From ea4e91d6666ca091d7cd3fae88476cb41f6ebe5c Mon Sep 17 00:00:00 2001 From: Antonios Barotsis Date: Sat, 27 Jun 2026 16:55:06 +0200 Subject: [PATCH 2/2] bump --- CHANGELOG.md | 7 +++++++ Cargo.toml | 8 ++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 309142c..d7ecbfa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,12 @@ and this project adheres to +## [0.27.0] - 2026-06-27 + +### Added + +- add received_for to inbound email and received event types (https://github.com/resend/resend-rust/pull/74) + ## [0.26.1] - 2026-06-18 ### Added @@ -540,6 +546,7 @@ Disabled `reqwest`'s default features and enabled `rustls-tls`. Initial release. +[0.27.0]: https://crates.io/crates/resend-rs/0.27.0 [0.26.1]: https://crates.io/crates/resend-rs/0.26.1 [0.26.0]: https://crates.io/crates/resend-rs/0.26.0 [0.25.1]: https://crates.io/crates/resend-rs/0.25.1 diff --git a/Cargo.toml b/Cargo.toml index 4512f6e..7446514 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "resend-rs" -version = "0.26.1" +version = "0.27.0" edition = "2024" license = "MIT" @@ -37,12 +37,12 @@ thiserror = { version = "2.0" } maybe-async = { version = "0.2.11" } governor = "0.10.4" rand = "0.10.1" -getrandom = { version = "0.4.2", features = ["wasm_js"] } +getrandom = { version = "0.4.3", features = ["wasm_js"] } serde_json = "1.0.150" mailparse = "0.16.1" [dev-dependencies] -jiff = { version = "0.2.28", features = ["serde"] } +jiff = { version = "0.2.29", features = ["serde"] } tokio = { version = "1.52.3", features = [ "macros", "test-util", @@ -53,7 +53,7 @@ scraper = "0.27.0" regex = "1.12.4" # Used in examples axum = "0.8.9" -svix = "1.95.2" +svix = "1.96.1" http-body-util = "0.1.3" tokio-shared-rt = "0.1.0" anyhow = "1.0"