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

Using .add_header() raises a TypeError #230

Closed
lydia-schow opened this issue Oct 7, 2016 · 1 comment
Closed

Using .add_header() raises a TypeError #230

lydia-schow opened this issue Oct 7, 2016 · 1 comment
Labels
status: help wanted requesting help from the community type: bug bug in the library

Comments

@lydia-schow
Copy link

lydia-schow commented Oct 7, 2016

Issue Summary

.add_header() cannot be used because python raises a TypeError exception.

Steps to Reproduce

  1. Create an instance of Mail mail = Mail( Email(from_email), subject, Email(to_emails), Content('text/html', message) )
  2. Add a header to the instance
    mail.add_header( {'Reply-To' : '[email protected], [email protected]'} )
  3. Send the Request
    response = sg.client.mail.send.post(request_body=mail.get())

Stack Trace

File "mail.py", line 63, in get

headers.update(key**.get()**)

TypeError: get expected at least 1 arguments, got 0

@lydia-schow lydia-schow changed the title .add_header() throws a TypeError .add_header() raises a TypeError Oct 7, 2016
@lydia-schow lydia-schow changed the title .add_header() raises a TypeError Using .add_header() raises a TypeError Oct 7, 2016
@thinkingserious thinkingserious added type: bug bug in the library status: help wanted requesting help from the community hacktoberfest labels Oct 10, 2016
@thinkingserious
Copy link
Contributor

Hello @elijah-schow,

Thanks for reporting this issue! We have added it to our backlog for a fix.

navinpai pushed a commit to navinpai/sendgrid-python that referenced this issue Oct 11, 2016
Currently, mail.add_headers() can only accept an Header object. However,
many people tend to use {"header": "value"} style dictionaries. This adds
support for that use case

Resolves sendgrid#230
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: help wanted requesting help from the community type: bug bug in the library
Projects
None yet
Development

No branches or pull requests

2 participants