Mail helper docstring is wrong #569
Labels
difficulty: unknown or n/a
fix is unknown in difficulty
status: help wanted
requesting help from the community
type: bug
bug in the library
Issue Summary
The Mail helper docstring claims that all of its arguments are optional. However, if you fail to pass one of them then none of them are saved (it's all or nothing):
https://github.com/sendgrid/sendgrid-python/blob/master/sendgrid/helpers/mail/mail.py#L44
This was a major annoyance to debug (kept getting 400 Bad Request errors because the "from" and "to" emails were getting silently discarded since I was using explicit
add_content
calls to populate both plain text and HTML content after initializing the Mail object).My preference would be to have anything passed into the Mail helper populate its internal variables, thus making the docstring correct. Alternately, adjusting the docstring to make it clear the arguments are all or nothing would be very much appreciated.
Technical details:
The text was updated successfully, but these errors were encountered: