File tree 7 files changed +25
-13
lines changed
module-email-attachments-admin-ui
module-email-attachments-api
7 files changed +25
-13
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
5
5
The format is based on [ Keep a Changelog] ( http://keepachangelog.com/en/1.0.0/ )
6
6
and this project adheres to [ Semantic Versioning] ( http://semver.org/spec/v2.0.0.html ) .
7
7
8
+ ## [ 2.2.1] - 2024-07-08
9
+
10
+ ### Fixed
11
+
12
+ - Fix type id error (` int ` versus ` string ` )
13
+ - Fix wrong template type check
14
+
8
15
## [ 2.2.0] - 2024-06-19
9
16
10
17
### Changed
Original file line number Diff line number Diff line change 2
2
"name" : " team23/module-email-attachments" ,
3
3
"description" : " Attach different files to transaction mails" ,
4
4
"type" : " magento2-component" ,
5
- "version" : " 2.2.0 " ,
5
+ "version" : " 2.2.1 " ,
6
6
"license" : [" BSD-3-Clause" ],
7
7
"authors" : [
8
8
{
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " team23/module-email-attachments-admin-ui" ,
3
3
"description" : " Attach different files to transaction mails." ,
4
- "version" : " 2.2.0 " ,
4
+ "version" : " 2.2.1 " ,
5
5
"type" : " magento2-module" ,
6
6
"license" : [" BSD-3-Clause" ],
7
7
"authors" : [
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " team23/module-email-attachments-api" ,
3
3
"description" : " Attach different files to transaction mails" ,
4
- "version" : " 2.2.0 " ,
4
+ "version" : " 2.2.1 " ,
5
5
"type" : " magento2-module" ,
6
6
"license" : [" BSD-3-Clause" ],
7
7
"authors" : [
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ public function sendCopyTo()
75
75
private function addAttachments (): array
76
76
{
77
77
$ templateVars = $ this ->templateContainer ->getTemplateVars ();
78
- $ storeId = $ templateVars ['store ' ]->getId ();
78
+ $ storeId = ( int ) $ templateVars ['store ' ]->getId ();
79
79
$ type = false ;
80
80
$ result = [];
81
81
Original file line number Diff line number Diff line change @@ -183,14 +183,19 @@ protected function prepareMessage()
183
183
$ template = $ this ->getTemplate ();
184
184
$ content = $ template ->processTemplate ();
185
185
186
- $ partType = match ($ template ->getType ()) {
187
- TemplateTypesInterface::TYPE_TEXT => MimeInterface::TYPE_TEXT ,
188
- TemplateTypesInterface::TYPE_HTML => MimeInterface::TYPE_HTML ,
189
- default => throw new LocalizedException (
190
- new Phrase ('Unknown template type ' )
191
- ),
192
- };
193
- $ mimePart = $ this ->mimePartInterfaceFactory ->create (['content ' => $ content , 'type ' => $ partType ]);
186
+ switch ($ template ->getType ()) {
187
+ case TemplateTypesInterface::TYPE_TEXT :
188
+ $ part ['type ' ] = MimeInterface::TYPE_TEXT ;
189
+ break ;
190
+ case TemplateTypesInterface::TYPE_HTML :
191
+ $ part ['type ' ] = MimeInterface::TYPE_HTML ;
192
+ break ;
193
+ default :
194
+ throw new LocalizedException (
195
+ new Phrase ('Unknown template type ' )
196
+ );
197
+ }
198
+ $ mimePart = $ this ->mimePartInterfaceFactory ->create (['content ' => $ content ]);
194
199
$ parts = [$ mimePart ];
195
200
196
201
foreach ($ this ->attachments as $ attachment ) {
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " team23/module-email-attachments" ,
3
3
"description" : " Attach different files to transaction mails." ,
4
- "version" : " 2.2.0 " ,
4
+ "version" : " 2.2.1 " ,
5
5
"type" : " magento2-module" ,
6
6
"license" : [" BSD-3-Clause" ],
7
7
"authors" : [
You can’t perform that action at this time.
0 commit comments