From 1e275b188d90fed6bd39c1039908ae11fb220dbd Mon Sep 17 00:00:00 2001 From: Ricardo Espinoza Date: Tue, 13 Oct 2020 09:05:09 -0400 Subject: [PATCH] :zap: Small fix on AWS SES-Node (#1049) --- packages/nodes-base/nodes/Aws/SES/AwsSes.node.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/nodes-base/nodes/Aws/SES/AwsSes.node.ts b/packages/nodes-base/nodes/Aws/SES/AwsSes.node.ts index 1eadf6da14..f26a52609b 100644 --- a/packages/nodes-base/nodes/Aws/SES/AwsSes.node.ts +++ b/packages/nodes-base/nodes/Aws/SES/AwsSes.node.ts @@ -664,7 +664,7 @@ export class AwsSes implements INodeType { } } - responseData = await awsApiRequestSOAP.call(this, 'email', 'POST', '/?Action=send&' + params.join('&')); + responseData = await awsApiRequestSOAP.call(this, 'email', 'POST', '/?Action=SendEmail&' + params.join('&')); } if (operation === 'sendTemplate') { @@ -726,11 +726,13 @@ export class AwsSes implements INodeType { if (templateDataUi) { const templateDataValues = (templateDataUi as IDataObject).templateDataValues as IDataObject[]; const templateData: IDataObject = {}; - for (const key of Object.keys(templateDataValues)) { - //@ts-ignore - templateData[key]= templateDataValues[key]; + if (templateDataValues !== undefined) { + for (const key of Object.keys(templateDataValues)) { + //@ts-ignore + templateData[key]= templateDataValues[key]; + } + params.push(`TemplateData=${JSON.stringify(templateData)}`); } - params.push(`TemplateData=${JSON.stringify(templateData)}`); } responseData = await awsApiRequestSOAP.call(this, 'email', 'POST', '/?Action=SendTemplatedEmail&' + params.join('&'));