Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions sendgrid/helpers/mail/mail.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ class Mail(object):

Use get() to get the request body.
"""
def __init__(self,
from_email=None,
subject=None,
to_email=None,
def __init__(self,
from_email=None,
subject=None,
to_email=None,
content=None):
"""Create a Mail object.

Expand Down Expand Up @@ -73,7 +73,7 @@ def get(self):

if self.from_email is not None:
mail["from"] = self.from_email.get()

if self.subject is not None:
mail["subject"] = self.subject

Expand Down Expand Up @@ -306,7 +306,7 @@ def add_content(self, content):
"""
if self._contents is None:
self._contents = []

# Text content should be before HTML content
if content._type == "text/plain":
self._contents.insert(0, content)
Expand Down Expand Up @@ -376,9 +376,9 @@ def categories(self):
return self._categories

def add_category(self, category):
"""Add a Category to this Mail. Must be less than 255 characters.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was your reason behind this deletion?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since Category is a Category type Must be less than 255 characters. is not suitable.

"""Add a Category to this Mail.

:type category: string
:type category: Category

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is correct, thank you for pointing it out!

"""
self._categories.append(category)

Expand Down