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
a1692f2b
Commit
a1692f2b
authored
Nov 14, 2017
by
Sofiya Semenova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
White label support for email response notifications
parent
efd0381c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
lms/djangoapps/discussion/tasks.py
+14
-6
No files found.
lms/djangoapps/discussion/tasks.py
View file @
a1692f2b
...
@@ -7,6 +7,7 @@ from urllib import urlencode
...
@@ -7,6 +7,7 @@ from urllib import urlencode
from
urlparse
import
urljoin
from
urlparse
import
urljoin
from
celery
import
task
from
celery
import
task
from
crum
import
CurrentRequestUserMiddleware
from
django.conf
import
settings
from
django.conf
import
settings
from
django.contrib.auth.models
import
User
from
django.contrib.auth.models
import
User
from
django.contrib.sites.models
import
Site
from
django.contrib.sites.models
import
Site
...
@@ -23,6 +24,8 @@ import lms.lib.comment_client as cc
...
@@ -23,6 +24,8 @@ import lms.lib.comment_client as cc
from
openedx.core.djangoapps.content.course_overviews.models
import
CourseOverview
from
openedx.core.djangoapps.content.course_overviews.models
import
CourseOverview
from
openedx.core.djangoapps.schedules.template_context
import
get_base_template_context
from
openedx.core.djangoapps.schedules.template_context
import
get_base_template_context
from
openedx.core.djangoapps.theming.middleware
import
CurrentSiteThemeMiddleware
from
openedx.core.lib.celery.task_utils
import
emulate_http_request
log
=
logging
.
getLogger
(
__name__
)
log
=
logging
.
getLogger
(
__name__
)
...
@@ -44,12 +47,17 @@ def send_ace_message(context):
...
@@ -44,12 +47,17 @@ def send_ace_message(context):
context
[
'site'
]
=
Site
.
objects
.
get
(
id
=
context
[
'site_id'
])
context
[
'site'
]
=
Site
.
objects
.
get
(
id
=
context
[
'site_id'
])
if
_should_send_message
(
context
):
if
_should_send_message
(
context
):
thread_author
=
User
.
objects
.
get
(
id
=
context
[
'thread_author_id'
])
thread_author
=
User
.
objects
.
get
(
id
=
context
[
'thread_author_id'
])
message_context
=
_build_message_context
(
context
)
middleware_classes
=
[
message
=
ResponseNotification
()
.
personalize
(
CurrentRequestUserMiddleware
,
Recipient
(
thread_author
.
username
,
thread_author
.
email
),
CurrentSiteThemeMiddleware
,
_get_course_language
(
context
[
'course_id'
]),
]
message_context
with
emulate_http_request
(
site
=
context
[
'site'
],
user
=
thread_author
,
middleware_classes
=
middleware_classes
):
)
message_context
=
_build_message_context
(
context
)
message
=
ResponseNotification
()
.
personalize
(
Recipient
(
thread_author
.
username
,
thread_author
.
email
),
_get_course_language
(
context
[
'course_id'
]),
message_context
)
log
.
info
(
'Sending forum comment email notification with context
%
s'
,
message_context
)
log
.
info
(
'Sending forum comment email notification with context
%
s'
,
message_context
)
ace
.
send
(
message
)
ace
.
send
(
message
)
...
...
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