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

Error: Empty from email address (required) #178

Closed
guy-codefresh opened this issue Jul 20, 2015 · 3 comments
Closed

Error: Empty from email address (required) #178

guy-codefresh opened this issue Jul 20, 2015 · 3 comments

Comments

@guy-codefresh
Copy link

I'm using the latest npm module version and when I try, even the simplest test, I'm getting the following error:
Error: Empty from email address (required)

This is the example code we are testing.
Up until few days ago all was working

var sendgrid = require("sendgrid")(API_KEY);

sendgrid.send({
to: 'example@example.com',
from: 'other@example.com',
subject: 'Hello World',
text: 'My first email through SendGrid.'
}, function(err, json) {
if (err) { return console.error(err); }
console.log(json);
});

@eddiezane
Copy link
Contributor

It looks like the upstream dependency request was updated today. Pinning it to the previous version 2.58.0 fixes things. Will roll out a new version locking it there until we can figure out what's up.

eddiezane added a commit that referenced this issue Jul 20, 2015
Something broke for us in request 2.59.0. See #178
@eddiezane
Copy link
Contributor

I just released version 1.9.1 with a pinned request version below 2.59.0. Will need to figure out what changed and write a better test to catch it.

Sorry for any trouble this caused you.

@eddiezane
Copy link
Contributor

It looks like the _send method needs to be rewritten. It was originally created to build out req.form() before the next event loop pass.

From the docs

For advanced cases, you can access the form-data object itself via r.form(). This can be modified until the request is fired on the next cycle of the event-loop. (Note that this calling form() will clear the currently set form data for that request.)

It seems that the content-type is now not set when doing this via request/request#1650.

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

No branches or pull requests

2 participants