Merge pull request #17754 from edx/mulby/email-send-noninteraction

mark email sent events as non-interactions
This commit is contained in:
Gabe Mulley
2018-05-14 16:15:37 -04:00
committed by GitHub
3 changed files with 5 additions and 1 deletions

View File

@@ -85,7 +85,8 @@ def _track_notification_sent(message, context):
'uuid': unicode(message.uuid),
'send_uuid': unicode(message.send_uuid),
'thread_id': context['thread_id'],
'thread_created_at': date.deserialize(context['thread_created_at'])
'thread_created_at': date.deserialize(context['thread_created_at']),
'nonInteraction': 1,
}
analytics.track(
user_id=context['thread_author_id'],

View File

@@ -298,6 +298,8 @@ class TaskTestCase(ModuleStoreTestCase):
for key, entry in test_props.items():
setattr(message, key, entry)
test_props['nonInteraction'] = True
with mock.patch('analytics.track') as mock_analytics_track:
_track_notification_sent(message, context)
mock_analytics_track.assert_called_once_with(

View File

@@ -216,6 +216,7 @@ def _track_message_sent(site, user, msg):
'language': msg.language,
'uuid': unicode(msg.uuid),
'send_uuid': unicode(msg.send_uuid),
'nonInteraction': 1,
}
course_ids = msg.context.get('course_ids', [])
properties['num_courses'] = len(course_ids)