diff --git a/resend/emails/_email.py b/resend/emails/_email.py index 09dd1af..04d517a 100644 --- a/resend/emails/_email.py +++ b/resend/emails/_email.py @@ -16,6 +16,10 @@ class _EmailDefaultAttrs(_FromParam): """ The Email ID. """ + message_id: str + """ + RFC Message-ID header value for the email. + """ to: Union[List[str], str] """ List of email addresses to send the email to. @@ -60,6 +64,7 @@ class Email(_EmailDefaultAttrs): Attributes: id (str): The Email ID. + message_id (str): RFC Message-ID header value for the email. from (str): The email address the email was sent from. to (Union[List[str], str]): List of email addresses to send the email to. created_at (str): When the email was created. diff --git a/tests/emails_test.py b/tests/emails_test.py index a6d661e..f1363bc 100644 --- a/tests/emails_test.py +++ b/tests/emails_test.py @@ -41,6 +41,7 @@ def test_email_get(self) -> None: { "object": "email", "id": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c", + "message_id": "<111-222-333@email.example.com>", "to": ["james@bond.com"], "from": "onboarding@resend.dev", "created_at": "2023-04-03T22:13:42.674981+00:00", @@ -58,6 +59,7 @@ def test_email_get(self) -> None: email_id="4ef9a417-02e9-4d39-ad75-9611e0fcc33c", ) assert email["id"] == "4ef9a417-02e9-4d39-ad75-9611e0fcc33c" + assert email["message_id"] == "<111-222-333@email.example.com>" def test_should_get_email_raise_exception_when_no_content(self) -> None: self.set_mock_json(None) @@ -165,6 +167,7 @@ def test_email_list(self) -> None: "data": [ { "id": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c", + "message_id": "<111-222-333@email.example.com>", "to": ["james@bond.com"], "from": "onboarding@resend.dev", "created_at": "2023-04-03T22:13:42.674981+00:00", @@ -178,6 +181,7 @@ def test_email_list(self) -> None: }, { "id": "5ef9a417-02e9-4d39-ad75-9611e0fcc33d", + "message_id": "<222-333-444@email.example.com>", "to": ["test@example.com"], "from": "hello@resend.dev", "created_at": "2023-04-04T10:15:42.674981+00:00", @@ -199,6 +203,7 @@ def test_email_list(self) -> None: assert len(emails["data"]) == 2 assert emails["has_more"] == True assert emails["data"][0]["id"] == "4ef9a417-02e9-4d39-ad75-9611e0fcc33c" + assert emails["data"][0]["message_id"] == "<111-222-333@email.example.com>" assert emails["data"][1]["id"] == "5ef9a417-02e9-4d39-ad75-9611e0fcc33d" def test_email_list_with_params(self) -> None: