Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
4d5f5c3f
Commit
4d5f5c3f
authored
Dec 19, 2017
by
Gregory Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Forum Notifications Email Tracking
parent
82ad9295
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
lms/djangoapps/discussion/tasks.py
+24
-0
No files found.
lms/djangoapps/discussion/tasks.py
View file @
4d5f5c3f
...
...
@@ -5,6 +5,7 @@ pertaining to new discussion forum comments.
import
logging
from
urlparse
import
urljoin
import
analytics
from
celery
import
task
from
django.conf
import
settings
from
django.contrib.auth.models
import
User
...
...
@@ -51,6 +52,29 @@ def send_ace_message(context):
)
log
.
info
(
'Sending forum comment email notification with context
%
s'
,
message_context
)
ace
.
send
(
message
)
_track_notification_sent
(
message
,
context
)
def
_track_notification_sent
(
message
,
context
):
"""
Send analytics event for a sent email
"""
properties
=
{
'site'
:
context
[
'site'
]
.
domain
,
'app_label'
:
'discussion'
,
'name'
:
'responsenotification'
,
'language'
:
message
.
language
,
'uuid'
:
unicode
(
message
.
uuid
),
'send_uuid'
:
unicode
(
message
.
send_uuid
),
'thread_id'
:
context
[
'thread_id'
],
'thread_created_at'
:
date
.
deserialize
(
context
[
'thread_created_at'
])
}
analytics
.
track
(
user_id
=
context
[
'thread_author_id'
],
event
=
'edx.bi.email.sent'
,
properties
=
properties
,
course_id
=
context
[
'course_id'
]
)
def
_should_send_message
(
context
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment