Skip to content

Commit 5651fc1

Browse files
Update generated code (#1788)
update generated code
1 parent ed33b00 commit 5651fc1

File tree

5 files changed

+119
-3
lines changed

5 files changed

+119
-3
lines changed

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"variables": {
3-
"${LATEST}": "3.325.0"
3+
"${LATEST}": "3.325.1"
44
},
55
"endpoints": "https://raw.githubusercontent.com/aws/aws-sdk-php/${LATEST}/src/data/endpoints.json",
66
"services": {

src/Service/Ses/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## NOT RELEASED
44

5+
### Added
6+
7+
- AWS api-change: This release enables customers to provide the email template content in the SESv2 SendEmail and SendBulkEmail APIs instead of the name or the ARN of a stored email template.
8+
59
## 1.8.2
610

711
### Changed

src/Service/Ses/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
},
2828
"extra": {
2929
"branch-alias": {
30-
"dev-master": "1.8-dev"
30+
"dev-master": "1.9-dev"
3131
}
3232
}
3333
}
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
<?php
2+
3+
namespace AsyncAws\Ses\ValueObject;
4+
5+
/**
6+
* The content of the email, composed of a subject line, an HTML part, and a text-only part.
7+
*/
8+
final class EmailTemplateContent
9+
{
10+
/**
11+
* The subject line of the email.
12+
*
13+
* @var string|null
14+
*/
15+
private $subject;
16+
17+
/**
18+
* The email body that will be visible to recipients whose email clients do not display HTML.
19+
*
20+
* @var string|null
21+
*/
22+
private $text;
23+
24+
/**
25+
* The HTML body of the email.
26+
*
27+
* @var string|null
28+
*/
29+
private $html;
30+
31+
/**
32+
* @param array{
33+
* Subject?: null|string,
34+
* Text?: null|string,
35+
* Html?: null|string,
36+
* } $input
37+
*/
38+
public function __construct(array $input)
39+
{
40+
$this->subject = $input['Subject'] ?? null;
41+
$this->text = $input['Text'] ?? null;
42+
$this->html = $input['Html'] ?? null;
43+
}
44+
45+
/**
46+
* @param array{
47+
* Subject?: null|string,
48+
* Text?: null|string,
49+
* Html?: null|string,
50+
* }|EmailTemplateContent $input
51+
*/
52+
public static function create($input): self
53+
{
54+
return $input instanceof self ? $input : new self($input);
55+
}
56+
57+
public function getHtml(): ?string
58+
{
59+
return $this->html;
60+
}
61+
62+
public function getSubject(): ?string
63+
{
64+
return $this->subject;
65+
}
66+
67+
public function getText(): ?string
68+
{
69+
return $this->text;
70+
}
71+
72+
/**
73+
* @internal
74+
*/
75+
public function requestBody(): array
76+
{
77+
$payload = [];
78+
if (null !== $v = $this->subject) {
79+
$payload['Subject'] = $v;
80+
}
81+
if (null !== $v = $this->text) {
82+
$payload['Text'] = $v;
83+
}
84+
if (null !== $v = $this->html) {
85+
$payload['Html'] = $v;
86+
}
87+
88+
return $payload;
89+
}
90+
}

src/Service/Ses/src/ValueObject/Template.php

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
/**
66
* An object that defines the email template to use for an email message, and the values to use for any message
77
* variables in that template. An *email template* is a type of message template that contains content that you want to
8-
* define, save, and reuse in email messages that you send.
8+
* reuse in email messages that you send. You can specifiy the email template by providing the name or ARN of an *email
9+
* template* previously saved in your Amazon SES account or by providing the full template content.
910
*/
1011
final class Template
1112
{
@@ -24,6 +25,16 @@ final class Template
2425
*/
2526
private $templateArn;
2627

28+
/**
29+
* The content of the template.
30+
*
31+
* > Amazon SES supports only simple substitions when you send email using the `SendEmail` or `SendBulkEmail` operations
32+
* > and you provide the full template content in the request.
33+
*
34+
* @var EmailTemplateContent|null
35+
*/
36+
private $templateContent;
37+
2738
/**
2839
* An object that defines the values to use for message variables in the template. This object is a set of key-value
2940
* pairs. Each key defines a message variable in the template. The corresponding value defines the value to use for that
@@ -44,6 +55,7 @@ final class Template
4455
* @param array{
4556
* TemplateName?: null|string,
4657
* TemplateArn?: null|string,
58+
* TemplateContent?: null|EmailTemplateContent|array,
4759
* TemplateData?: null|string,
4860
* Headers?: null|array<MessageHeader|array>,
4961
* } $input
@@ -52,6 +64,7 @@ public function __construct(array $input)
5264
{
5365
$this->templateName = $input['TemplateName'] ?? null;
5466
$this->templateArn = $input['TemplateArn'] ?? null;
67+
$this->templateContent = isset($input['TemplateContent']) ? EmailTemplateContent::create($input['TemplateContent']) : null;
5568
$this->templateData = $input['TemplateData'] ?? null;
5669
$this->headers = isset($input['Headers']) ? array_map([MessageHeader::class, 'create'], $input['Headers']) : null;
5770
}
@@ -60,6 +73,7 @@ public function __construct(array $input)
6073
* @param array{
6174
* TemplateName?: null|string,
6275
* TemplateArn?: null|string,
76+
* TemplateContent?: null|EmailTemplateContent|array,
6377
* TemplateData?: null|string,
6478
* Headers?: null|array<MessageHeader|array>,
6579
* }|Template $input
@@ -82,6 +96,11 @@ public function getTemplateArn(): ?string
8296
return $this->templateArn;
8397
}
8498

99+
public function getTemplateContent(): ?EmailTemplateContent
100+
{
101+
return $this->templateContent;
102+
}
103+
85104
public function getTemplateData(): ?string
86105
{
87106
return $this->templateData;
@@ -104,6 +123,9 @@ public function requestBody(): array
104123
if (null !== $v = $this->templateArn) {
105124
$payload['TemplateArn'] = $v;
106125
}
126+
if (null !== $v = $this->templateContent) {
127+
$payload['TemplateContent'] = $v->requestBody();
128+
}
107129
if (null !== $v = $this->templateData) {
108130
$payload['TemplateData'] = $v;
109131
}

0 commit comments

Comments
 (0)