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
3b6e5f89
Unverified
Commit
3b6e5f89
authored
Nov 14, 2017
by
Sofiya Semenova
Committed by
GitHub
Nov 14, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #16562 from edx/sofiya/wl-email-response-notifications
White label support for email response notifications
parents
6dcce5a8
a1692f2b
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 @
3b6e5f89
...
...
@@ -7,6 +7,7 @@ from urllib import urlencode
from
urlparse
import
urljoin
from
celery
import
task
from
crum
import
CurrentRequestUserMiddleware
from
django.conf
import
settings
from
django.contrib.auth.models
import
User
from
django.contrib.sites.models
import
Site
...
...
@@ -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.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__
)
...
...
@@ -44,12 +47,17 @@ def send_ace_message(context):
context
[
'site'
]
=
Site
.
objects
.
get
(
id
=
context
[
'site_id'
])
if
_should_send_message
(
context
):
thread_author
=
User
.
objects
.
get
(
id
=
context
[
'thread_author_id'
])
message_context
=
_build_message_context
(
context
)
message
=
ResponseNotification
()
.
personalize
(
Recipient
(
thread_author
.
username
,
thread_author
.
email
),
_get_course_language
(
context
[
'course_id'
]),
message_context
)
middleware_classes
=
[
CurrentRequestUserMiddleware
,
CurrentSiteThemeMiddleware
,
]
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
)
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