Skip to content

Disable open/click tracking response (round 2) #189

Description

@chadlagore

Issue Summary

Hello!

I'm receiving some odd feedback when I attempt to disable tracking settings for internal test messages. I explicitly set the enable parameter to False, but the response suggests I haven't done so.

Here is the output of print(e.read()):

{"errors":[{"message":"The click_tracking enable parameter is required.","field":"tracking_settings.click_tracking.enable","help":"http://sendgrid.com/docs/API_Reference/Web_API_v3/Mail/errors.html#message.tracking_settings.click_tracking.enable"},{"message":"The open_tracking enable parameter is required.","field":"tracking_settings.open_tracking.enable","help":"http://sendgrid.com/docs/API_Reference/Web_API_v3/Mail/errors.html#message.tracking_settings.open_tracking.enable"},{"message":"The subscription_tracking enable parameter is required.","field":"tracking_settings.subscription_tracking.enable","help":"http://sendgrid.com/docs/API_Reference/Web_API_v3/Mail/errors.html#message.tracking_settings.subscription_tracking.enable"}]}

Here is the relevant section of print(mail.get()):

'tracking_settings': {'subscription_tracking': {}, 'open_tracking': {}, 'click_tracking': {}},

I don't know if this is a bug, or if I'm improperly using the API. Thought I would bring it to your attention.

Thanks!

Steps to Reproduce

My code:

mail = Mail(from_email, subject, to_email, content)

if '@internalemailaddress.com' in email:
        tracking_settings = TrackingSettings()
        tracking_settings.set_click_tracking(ClickTracking(enable=False, False))
        tracking_settings.set_open_tracking(OpenTracking(enable=False))
        tracking_settings.set_subscription_tracking(SubscriptionTracking(enable=False))
        mail.set_tracking_settings(tracking_settings)

Technical details:

  • sendgrid-python Version: master (latest commit: d199afc)
  • Python Version: 3.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions