🔀 Merge pull request #473 from RicardoE105/feature/mailjet-fix

🐛 fix subject field
This commit is contained in:
Jan 2020-04-10 08:16:48 +02:00 committed by GitHub
commit 67ce56b572
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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