Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preview draft option bug #233

Open
avigoldman opened this issue Aug 12, 2018 · 0 comments
Open

Preview draft option bug #233

avigoldman opened this issue Aug 12, 2018 · 0 comments
Assignees
Labels

Comments

@avigoldman
Copy link
Contributor

avigoldman commented Aug 12, 2018

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

You can work around it by setting draft to "false" (as a string).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants