Skip to content

AWS SES requires template subject despite being marked optional #7578

@acarotin

Description

@acarotin

Checkboxes for prior research

Describe the bug

According to the EmailTemplateContent type definition, the subject field is marked as optional.
However, when creating an AWS SES template without providing a subject, SES returns an error and rejects the request.

Regression Issue

  • Select this option if this issue appears to be a regression.

SDK version number

@aws-sdk/[email protected]

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

v22.21.1

Reproduction Steps

await client.send(new CreateEmailTemplateCommand({
	TemplateName: 'Name',
	TemplateContent: {
		Text: 'text',
	},
}));

Observed Behavior

AWS SES rejects templates without a subject, returning an error

"errorType": "BadRequestException",
"errorMessage": "The subject must be specified.",

Expected Behavior

Templates should be accepted when the subject field is omitted, as indicated by the optional type definition.

Possible Solution

Either the subject field is truly optional (which I believe it should be), and the API call should succeed without providing one, or the type definition should be updated to mark it as required.

Additional Information/Context

No response

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.p2This is a standard priority issueservice-apiThis issue is due to a problem in a service API, not the SDK implementation.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions