Skip to content

Commit

Permalink
SESv2 send_email(): Ensure email-body is persisted (#6913)
Browse files Browse the repository at this point in the history
  • Loading branch information
bblommers authored Oct 14, 2023
1 parent 44fe39f commit 681f117
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion moto/sesv2/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def send_email(self) -> str:
source=from_email_address,
destinations=destination,
subject=content["Simple"]["Subject"]["Data"],
body=content["Simple"]["Subject"]["Data"],
body=content["Simple"]["Body"]["Text"]["Data"],
)
elif "Template" in content:
raise NotImplementedError("Template functionality not ready")
Expand Down
6 changes: 6 additions & 0 deletions tests/test_sesv2/test_sesv2.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ def test_send_email(ses_v1): # pylint: disable=redefined-outer-name
sent_count = int(send_quota["SentLast24Hours"])
assert sent_count == 3

if not settings.TEST_SERVER_MODE:
backend = ses_backends[DEFAULT_ACCOUNT_ID]["us-east-1"]
msg: RawMessage = backend.sent_messages[0]
assert msg.subject == "test subject"
assert msg.body == "test body"


@mock_sesv2
def test_send_raw_email(ses_v1): # pylint: disable=redefined-outer-name
Expand Down

0 comments on commit 681f117

Please sign in to comment.