sklarsa / django-sendgrid-v5

An implementation of Django's EmailBackend compatible with sendgrid-python v5+
MIT License
318 stars 54 forks source link

Adding tracking for click and subscription settings #50

Closed tomasgarzon closed 4 years ago

sklarsa commented 5 years ago

Ah I'll try to fix these tests to get your code merged

sklarsa commented 5 years ago

Can you merge dev into this branch and push again? Thanks!

sklarsa commented 5 years ago

It looks like the tests are still failing, can you take a look?

======================================================================
FAIL: test_EmailMessage_custom_args (test.test_mail.TestMailGeneration)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/sklarsa/django-sendgrid-v5/test/test_mail.py", line 424, in test_EmailMessage_custom_args
    self.assertDictEqual(result, expected)
AssertionError: {'tracking_settings': {'subscription_tracking': {'enable': False}, 'open_trackin [truncated]... != {'tracking_settings': {'open_tracking': {'enable': True}}, 'personalizations': [ [truncated]...
  {'content': [{'type': 'text/plain', 'value': 'Hello, World!'}],
   'from': {'email': 'sam.smith@example.com', 'name': 'Sam Smith'},
   'mail_settings': {'sandbox_mode': {'enable': False}},
   'personalizations': [{'bcc': [{'email': 'sarah.smith@example.com',
                                  'name': 'Sarah Smith'}],
                         'cc': [{'email': 'stephanie.smith@example.com',
                                 'name': 'Stephanie Smith'}],
                         'custom_args': {'arg_1': 'Foo', 'arg_2': 'bar'},
                         'subject': 'Hello, World!',
                         'to': [{'email': 'john.doe@example.com',
                                 'name': 'John Doe'},
                                {'email': 'jane.doe@example.com'}]}],
   'reply_to': {'email': 'sam.smith@example.com', 'name': 'Sam Smith'},
   'subject': 'Hello, World!',
-  'tracking_settings': {'click_tracking': {'enable': True},
?                         ^^^^^                            ^
+  'tracking_settings': {'open_tracking': {'enable': True}}}
?                         ^^^^                            ^^
-                        'open_tracking': {'enable': True},
-                        'subscription_tracking': {'enable': False}}}
sklarsa commented 5 years ago

@tomasgarzon just reminding you about this

tomasgarzon commented 4 years ago

Hi @sklarsa Pull Request updated