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

Set From Name #152

Closed
timcosta opened this issue Jan 20, 2015 · 1 comment
Closed

Set From Name #152

timcosta opened this issue Jan 20, 2015 · 1 comment

Comments

@timcosta
Copy link

In the past, a string in the format of "Display Name email@address.com" was acceted as the setFrom, but it is not anymore. Will this be making a reappearance, or is there another way to get this same effect?

@eddiezane
Copy link
Contributor

There are two ways you can achieve this.

var sendgrid  = require('sendgrid')(api_user, api_key);
sendgrid.send({
  to:       'example@example.com',
  from:     'other@example.com',
  fromname: 'Foo Barista', // <=======
  subject:  'Hello World',
  text:     'My first email through SendGrid.'
}, function(err, json) {
  if (err) { return console.error(err); }
  console.log(json);
});
var email = new sendgrid.Email();
email.from = 'foo@example.com';
email.fromname = 'Foo Barista';
...

sendgrid.send(email, function());

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