Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(AWS SES Node): Encode template parameters properly #13570

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions packages/nodes-base/nodes/Aws/SES/AwsSes.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1176,13 +1176,15 @@ export class AwsSes implements INodeType {
const additionalFields = this.getNodeParameter('additionalFields', i);

const params = [
`Template.TemplateName=${templateName}`,
`Template.SubjectPart=${subjectPart}`,
`Template.HtmlPart=<h1>${htmlPart}</h1>`,
`Template.TemplateName=${encodeURIComponent(templateName)}`,
`Template.SubjectPart=${encodeURIComponent(subjectPart)}`,
`Template.HtmlPart=${encodeURIComponent(htmlPart)}`,
];

if (additionalFields.textPart) {
params.push(`Template.TextPart=${additionalFields.textPart}`);
params.push(
`Template.TextPart=${encodeURIComponent(additionalFields.textPart as string)}`,
);
}

responseData = await awsApiRequestSOAP.call(
Expand Down Expand Up @@ -1256,18 +1258,24 @@ export class AwsSes implements INodeType {

const updateFields = this.getNodeParameter('updateFields', i);

const params = [`Template.TemplateName=${templateName}`];
const params = [`Template.TemplateName=${encodeURIComponent(templateName)}`];

if (updateFields.textPart) {
params.push(`Template.TextPart=${updateFields.textPart}`);
params.push(
`Template.TextPart=${encodeURIComponent(updateFields.textPart as string)}`,
);
}

if (updateFields.subjectPart) {
params.push(`Template.SubjectPart=${updateFields.subjectPart}`);
params.push(
`Template.SubjectPart=${encodeURIComponent(updateFields.subjectPart as string)}`,
);
}

if (updateFields.subjectPart) {
params.push(`Template.HtmlPart=${updateFields.htmlPart}`);
params.push(
`Template.HtmlPart=${encodeURIComponent(updateFields.htmlPart as string)}`,
);
}

responseData = await awsApiRequestSOAP.call(
Expand Down
Loading