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

chore: get rid of reply_to in mail helper #1003

Merged
merged 1 commit into from
Aug 18, 2021
Merged
Show file tree
Hide file tree
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
7 changes: 0 additions & 7 deletions sendgrid/helpers/mail/mail.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ def __init__(
self,
from_email=None,
to_emails=None,
reply_to=None,
subject=None,
plain_text_content=None,
html_content=None,
Expand All @@ -41,8 +40,6 @@ def __init__(
:param to_emails: The email address of the recipient
:type to_emails: To, str, tuple, list(str), list(tuple),
list(To), optional
:param reply_to: The email address to reply to
:type reply_to: ReplyTo, tuple, optional
:param plain_text_content: The plain text body of the email
:type plain_text_content: string, optional
:param html_content: The html body of the email
Expand Down Expand Up @@ -82,10 +79,6 @@ def __init__(
if html_content is not None:
self.add_content(html_content, MimeType.html)

# Optional
if reply_to is not None:
self.reply_to = reply_to

def __str__(self):
"""A JSON-ready string representation of this Mail object.

Expand Down
9 changes: 2 additions & 7 deletions test/test_mail_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,12 @@ def test_batch_id(self):

# Send a Single Email to a Single Recipient
def test_single_email_to_a_single_recipient(self):
from sendgrid.helpers.mail import (Mail, From, To, ReplyTo, Subject,
from sendgrid.helpers.mail import (Mail, From, To, Subject,
PlainTextContent, HtmlContent)
self.maxDiff = None
message = Mail(
from_email=From('[email protected]', 'Example From Name'),
to_emails=To('[email protected]', 'Example To Name'),
reply_to=ReplyTo('[email protected]', 'Example Reply To Name'),
subject=Subject('Sending with SendGrid is Fun'),
plain_text_content=PlainTextContent(
'and easy to do anywhere, even with Python'),
Expand All @@ -124,10 +123,6 @@ def test_single_email_to_a_single_recipient(self):
"email": "[email protected]",
"name": "Example From Name"
},
"reply_to": {
"email": "[email protected]",
"name": "Example Reply To Name"
},
"personalizations": [
{
"to": [
Expand Down Expand Up @@ -660,7 +655,7 @@ def test_personalization_add_email_filters_out_duplicate_to_emails(self):
p.add_email(to_email)

self.assertEqual([to_email.get()], p.tos)

def test_personalization_add_email_filters_out_duplicate_to_emails_ignoring_case(self):
self.maxDiff = None

Expand Down
1 change: 0 additions & 1 deletion use_cases/send_a_single_email_to_a_single_recipient.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ from sendgrid.helpers.mail import Mail
message = Mail(
from_email='[email protected]',
to_emails='[email protected]',
reply_to='[email protected]',
subject='Sending with Twilio SendGrid is Fun',
html_content='<strong>and easy to do anywhere, even with Python</strong>')
try:
Expand Down