diff --git a/src/main/java/com/resend/services/emails/model/Email.java b/src/main/java/com/resend/services/emails/model/Email.java index f6956f0..2497852 100644 --- a/src/main/java/com/resend/services/emails/model/Email.java +++ b/src/main/java/com/resend/services/emails/model/Email.java @@ -43,6 +43,9 @@ public class Email { @JsonProperty("last_event") private String lastEvent; + @JsonProperty("message_id") + private String messageId; + /** * Default constructor. */ @@ -273,5 +276,21 @@ public String getLastEvent() { public void setLastEvent(String lastEvent) { this.lastEvent = lastEvent; } + + /** + * Get the message ID of the email. + * @return The message ID. + */ + public String getMessageId() { + return messageId; + } + + /** + * Set the message ID of the email. + * @param messageId The message ID. + */ + public void setMessageId(String messageId) { + this.messageId = messageId; + } } diff --git a/src/test/java/com/resend/services/emails/EmailsTest.java b/src/test/java/com/resend/services/emails/EmailsTest.java index c638186..0ec753f 100644 --- a/src/test/java/com/resend/services/emails/EmailsTest.java +++ b/src/test/java/com/resend/services/emails/EmailsTest.java @@ -36,7 +36,8 @@ public class EmailsTest { "\"html\":\"This is the HTML content\"," + "\"text\":\"This is the plain text content\"," + "\"bcc\":[\"bcc@example.com\"],\"cc\":[\"cc@example.com\"]," + - "\"reply_to\":[\"replyto@example.com\"],\"last_event\":\"last_event_status\"}"; + "\"reply_to\":[\"replyto@example.com\"],\"last_event\":\"last_event_status\"," + + "\"message_id\":\"111-222-333@email.example.com\"}"; private static final String UPDATE_RESPONSE_JSON = "{\"id\":\"" + UPDATE_EMAIL_ID + "\",\"object\":\"emails\"}"; @@ -125,6 +126,7 @@ public void testRetrieveEmail_Success() throws ResendException { assertNotNull(response); assertEquals(EMAIL_ID, response.getId()); assertEquals("sender@example.com", response.getFrom()); + assertEquals("111-222-333@email.example.com", response.getMessageId()); } @Test