fix(ses): require template data on v2 template sends and answer empty bulk destinations first (#9893)

A v2 template send without TemplateData, or with an empty string, read
it as {}. SendBulkEmail now answers 400 BadRequestException "The default
template data does not exist" and SendEmail "Template data cannot be
empty", ahead of the configuration set lookup and the sender check.
A SendBulkEmail in which no entry names a recipient answers every entry
INVALID_PARAMETER "Destination cannot be empty" even when its
configuration set is unknown or paused. With a recipient, a bulk send
looks its configuration set up first and refuses a paused one only after
the sender check.
This commit is contained in:
Kenshin Okinaka authored and GitHub committed 2026-12-01 10:21:59 -04:00
1 parent e8fdc11ba3
commit e8bfef562c
14 files changed
+329 -35

No files matched your search

@@ -452,6 +452,7 @@ class SesEventPublishingTest {
.subject("bulk-subject")
.text("bulk body")
.build())
.templateData("{}")
.headers(MessageHeader.builder()
.name("X-Mailer").value("default").build())
.build())
@@ -518,6 +518,7 @@ class SesTemplateTest {
.defaultContent(BulkEmailContent.builder()
.template(Template.builder()
.templateName("sdk-v2-bulk-missing-" + System.currentTimeMillis())
.templateData("{}")
.build())
.build())
.bulkEmailEntries(BulkEmailEntry.builder()