Open avigoldman opened 6 years ago
Looks like we have a bug with the template preview function.
sparkpost.templates.preview('template-id', { substitution_data: {}, draft: false })
This code will actually preview the draft since the code is falsey checking the draft option. We need to update it to check if the object has the draft property, instead of if the value is truthy. Line with the issue: https://github.com/SparkPost/node-sparkpost/blob/master/lib/templates.js#L143
draft
You can work around it by setting draft to "false" (as a string).
"false"
Looks like we have a bug with the template preview function.
This code will actually preview the draft since the code is falsey checking the
draft
option. We need to update it to check if the object has the draft property, instead of if the value is truthy. Line with the issue: https://github.com/SparkPost/node-sparkpost/blob/master/lib/templates.js#L143You can work around it by setting
draft
to"false"
(as a string).