Repository navigation
Closed
Labels
status: help wantedrequesting help from the communityrequesting help from the communitytype: bugbug in the librarybug in the library
Description
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
Reacted by Kevin Brown-Silva
Metadata
Metadata
Assignees
Labels
status: help wantedrequesting help from the communityrequesting help from the communitytype: bugbug in the librarybug in the library
Activity
chadlagore commentedon Jul 11, 2016
I've made a workaround that is working for the time being. Helper function:
Where
data = mail.get(). Apply after you perform the personalizations using Personalization class, and before you pass tosg.client.mail.send.post(request_body = data).thinkingserious commentedon Jul 11, 2016
Hello @inversquare,
I believe you have found a bug similar to sendgrid/sendgrid-go#68
Thanks for sharing your work around before we get it fixed!
Please email us at dx@sendgrid.com with your T-shirt size and address so that we can send you some swag :)
thinkingserious commentedon Jul 11, 2016
@inversquare,
This is now fixed with version 3.0.5: https://github.com/sendgrid/sendgrid-python/releases/tag/v3.0.5
Thanks!
Version Bump v3.0.5: Fixed logic errors related to issue #189
kontinuity commentedon Aug 3, 2016
I am facing the same issue with
sendgrid==3.1.10. The data generated only hasenable_textin it and throws the above error. Sample output for reference:Code:
thinkingserious commentedon Aug 4, 2016
Thanks for the heads up @kontinuity!
You can follow that bug here: #202
thinkingserious commentedon Aug 4, 2016
@kontinuity,
I was unable to reproduce this.
Could you please tell me the value of
tracking_enabledin your sample code?I used
tracking_enabled = Trueaaron-maslim commentedon Nov 23, 2016
@thinkingserious The tracking_enabled is False . You missed changing the if in one of the helpers
thinkingserious commentedon Nov 29, 2016
Thanks for the heads up @aaron-maslim! I will take another look.
[-]Disable open/click tracking response[/-][+]Disable open/click tracking response (round 2)[/+]HUSSTECH commentedon Mar 19, 2017
Just updating that this issue is still present in 3.6.3. But there is a pretty nice workaround using the
set_enable()method of theClickTracking()object. Just do:thinkingserious commentedon Mar 20, 2017
Thank you @HUSSTECH!
I've added your vote to this issue to help increase its priority in our backlog queue.