mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 03:12:15 +00:00
fix(AWS SES Node): Encode template parameters properly (#13570)
Co-authored-by: Shireen Missi <shireen@n8n.io>
This commit is contained in:
@@ -1081,16 +1081,11 @@ export class AwsSes implements INodeType {
|
||||
|
||||
if (operation === 'sendTemplate') {
|
||||
const toAddresses = this.getNodeParameter('toAddresses', i) as string[];
|
||||
|
||||
const template = this.getNodeParameter('templateName', i) as string;
|
||||
|
||||
const fromEmail = this.getNodeParameter('fromEmail', i) as string;
|
||||
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i);
|
||||
|
||||
const templateDataUi = this.getNodeParameter('templateDataUi', i) as IDataObject;
|
||||
|
||||
const params = [`Template=${template}`, `Source=${fromEmail}`];
|
||||
const params = [`Template=${template}`, `Source=${encodeURIComponent(fromEmail)}`];
|
||||
|
||||
if (toAddresses.length) {
|
||||
setParameter(params, 'Destination.ToAddresses.member', toAddresses);
|
||||
@@ -1150,7 +1145,7 @@ export class AwsSes implements INodeType {
|
||||
//@ts-ignore
|
||||
templateData[templateDataValue.key] = templateDataValue.value;
|
||||
}
|
||||
params.push(`TemplateData=${JSON.stringify(templateData)}`);
|
||||
params.push(`TemplateData=${encodeURIComponent(JSON.stringify(templateData))}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1176,13 +1171,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(
|
||||
@@ -1256,18 +1253,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(
|
||||
|
||||
Reference in New Issue
Block a user