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

custom_args properties must be strings - fails with 400 with no info if not #288

Closed
danconnell opened this issue Sep 6, 2016 · 4 comments
Labels
type: question question directed at the library

Comments

@danconnell
Copy link

Issue Summary

I was migrating from v2 to v3 and came across that when an email with custom arguments has non-string properties, the email doesn't send and the response is an unhelpful 400.

Steps to Reproduce

I tried adding a custom_args property to an email I was sending that looked like this:

custom_args: {
  user_id: 1234
}

The response I got back: 400 Bad Request and JSON was

{
  "errors":[{
    "message":"Bad Request",
    "field":null,
    "help":null
  }]
}

Needless to say, this was very unhelpful. And, given that I had a bunch of other properties on my email, I had to debug them 1 by 1 to find out what it was that was doing this.

The SendGrid API needs to send back more helpful information in this case. Perhaps this package could cast everything to a string in the custom_args property?

Technical details:

  • sendgrid-nodejs Version: 4.0.2
  • Node.js Version: 4.2.6
@thinkingserious thinkingserious added the type: question question directed at the library label Sep 9, 2016
@thinkingserious
Copy link
Contributor

@danconnell,

This issue is already on our backlog to be fixed at the API level (providing a better error response).

We are currently in the planning phases for improvements to the Mail Helper and your suggestion has been added.

In appreciation for you taking the time to provide detailed feedback, we'd like to send you a T-shirt. Could you email us at dx@sendgrid.com with your mailing address and T-shirt size?

Thanks!

@danconnell
Copy link
Author

Thanks! Good to know it is in the pipeline.

@enricribas
Copy link

Seriously?! I spent hours trying to find this bug. At least put it in the docs somewhere if I can't pass an integer in the custom args. ughhh!

@thinkingserious
Copy link
Contributor

Thanks for the heads up @enricribas, hours spent on this is not acceptable. When you get a moment, I would appreciate an upvote to issue #658 to give it higher priority in our backlog.

With Best Regards,

Elmer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question question directed at the library
Projects
None yet
Development

No branches or pull requests

3 participants