@@ -1081,16 +1081,11 @@ export class AwsSes implements INodeType {
10811081
10821082 if ( operation === 'sendTemplate' ) {
10831083 const toAddresses = this . getNodeParameter ( 'toAddresses' , i ) as string [ ] ;
1084-
10851084 const template = this . getNodeParameter ( 'templateName' , i ) as string ;
1086-
10871085 const fromEmail = this . getNodeParameter ( 'fromEmail' , i ) as string ;
1088-
10891086 const additionalFields = this . getNodeParameter ( 'additionalFields' , i ) ;
1090-
10911087 const templateDataUi = this . getNodeParameter ( 'templateDataUi' , i ) as IDataObject ;
1092-
1093- const params = [ `Template=${ template } ` , `Source=${ fromEmail } ` ] ;
1088+ const params = [ `Template=${ template } ` , `Source=${ encodeURIComponent ( fromEmail ) } ` ] ;
10941089
10951090 if ( toAddresses . length ) {
10961091 setParameter ( params , 'Destination.ToAddresses.member' , toAddresses ) ;
@@ -1150,7 +1145,7 @@ export class AwsSes implements INodeType {
11501145 //@ts -ignore
11511146 templateData [ templateDataValue . key ] = templateDataValue . value ;
11521147 }
1153- params . push ( `TemplateData=${ JSON . stringify ( templateData ) } ` ) ;
1148+ params . push ( `TemplateData=${ encodeURIComponent ( JSON . stringify ( templateData ) ) } ` ) ;
11541149 }
11551150 }
11561151
@@ -1176,13 +1171,15 @@ export class AwsSes implements INodeType {
11761171 const additionalFields = this . getNodeParameter ( 'additionalFields' , i ) ;
11771172
11781173 const params = [
1179- `Template.TemplateName=${ templateName } ` ,
1180- `Template.SubjectPart=${ subjectPart } ` ,
1181- `Template.HtmlPart=<h1> ${ htmlPart } </h1> ` ,
1174+ `Template.TemplateName=${ encodeURIComponent ( templateName ) } ` ,
1175+ `Template.SubjectPart=${ encodeURIComponent ( subjectPart ) } ` ,
1176+ `Template.HtmlPart=${ encodeURIComponent ( htmlPart ) } ` ,
11821177 ] ;
11831178
11841179 if ( additionalFields . textPart ) {
1185- params . push ( `Template.TextPart=${ additionalFields . textPart } ` ) ;
1180+ params . push (
1181+ `Template.TextPart=${ encodeURIComponent ( additionalFields . textPart as string ) } ` ,
1182+ ) ;
11861183 }
11871184
11881185 responseData = await awsApiRequestSOAP . call (
@@ -1256,18 +1253,24 @@ export class AwsSes implements INodeType {
12561253
12571254 const updateFields = this . getNodeParameter ( 'updateFields' , i ) ;
12581255
1259- const params = [ `Template.TemplateName=${ templateName } ` ] ;
1256+ const params = [ `Template.TemplateName=${ encodeURIComponent ( templateName ) } ` ] ;
12601257
12611258 if ( updateFields . textPart ) {
1262- params . push ( `Template.TextPart=${ updateFields . textPart } ` ) ;
1259+ params . push (
1260+ `Template.TextPart=${ encodeURIComponent ( updateFields . textPart as string ) } ` ,
1261+ ) ;
12631262 }
12641263
12651264 if ( updateFields . subjectPart ) {
1266- params . push ( `Template.SubjectPart=${ updateFields . subjectPart } ` ) ;
1265+ params . push (
1266+ `Template.SubjectPart=${ encodeURIComponent ( updateFields . subjectPart as string ) } ` ,
1267+ ) ;
12671268 }
12681269
12691270 if ( updateFields . subjectPart ) {
1270- params . push ( `Template.HtmlPart=${ updateFields . htmlPart } ` ) ;
1271+ params . push (
1272+ `Template.HtmlPart=${ encodeURIComponent ( updateFields . htmlPart as string ) } ` ,
1273+ ) ;
12711274 }
12721275
12731276 responseData = await awsApiRequestSOAP . call (
0 commit comments