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

helpers.Mail: warn on incorrect invocation #559

Closed
wants to merge 1 commit into from
Closed
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
4 changes: 4 additions & 0 deletions sendgrid/helpers/mail/mail.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""v3/mail/send response body builder"""
import logging

from .personalization import Personalization
from .header import Header

Expand Down Expand Up @@ -48,6 +50,8 @@ def __init__(
personalization.add_to(to_email)
self.add_personalization(personalization)
self.add_content(content)
elif from_email or subject or to_email or content:
logging.warn('sendgrid.helpers.mail.Mail(): not initialized with all four parameters, init-discarding values')

def __str__(self):
"""Get a JSON representation of this Mail request.
Expand Down