🐛 Fix SendGrid dynamic field generation (#1631)

This commit is contained in:
Loran 2021-04-07 16:43:11 +03:00 committed by GitHub
parent 8276cdfda1
commit f74ddb5221
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -361,10 +361,9 @@ export class SendGrid implements INodeType {
};
if (fields) {
body.personalizations[0].dynamic_template_data = {}
fields.forEach(field => {
body.personalizations[0].dynamic_template_data = {
[field.key]: field.value,
};
body.personalizations[0].dynamic_template_data![field.key] = field.value;
});
}