🐛 fix subject field

This commit is contained in:
ricardo 2020-04-09 20:33:42 -04:00
parent be9474e84a
commit 5521dd9ada

View file

@ -98,6 +98,7 @@ export class Mailjet implements INodeType {
const fromEmail = this.getNodeParameter('fromEmail', i) as string; const fromEmail = this.getNodeParameter('fromEmail', i) as string;
const htmlBody = this.getNodeParameter('html', i) as string; const htmlBody = this.getNodeParameter('html', i) as string;
const textBody = this.getNodeParameter('text', i) as string; const textBody = this.getNodeParameter('text', i) as string;
const subject = this.getNodeParameter('subject', i) as string;
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject; const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
const toEmail = (this.getNodeParameter('toEmail', i) as string).split(',') as string[]; const toEmail = (this.getNodeParameter('toEmail', i) as string).split(',') as string[];
const variables = (this.getNodeParameter('variablesUi', i) as IDataObject).variablesValues as IDataObject[]; const variables = (this.getNodeParameter('variablesUi', i) as IDataObject).variablesValues as IDataObject[];
@ -108,6 +109,7 @@ export class Mailjet implements INodeType {
From: { From: {
email: fromEmail, email: fromEmail,
}, },
subject,
to: [], to: [],
Cc: [], Cc: [],
Bcc: [], Bcc: [],
@ -154,10 +156,6 @@ export class Mailjet implements INodeType {
}); });
} }
} }
if (additionalFields.subject) {
//@ts-ignore
body.Messages[0].subject = additionalFields.subject as string;
}
if (additionalFields.trackOpens) { if (additionalFields.trackOpens) {
//@ts-ignore //@ts-ignore
body.Messages[0].TrackOpens = additionalFields.trackOpens as string; body.Messages[0].TrackOpens = additionalFields.trackOpens as string;