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
9861c935
Commit
9861c935
authored
Oct 10, 2013
by
Brian Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change calls in beta instructor dash.
parent
22285da1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
18 deletions
+10
-18
lms/djangoapps/instructor/views/api.py
+10
-14
lms/djangoapps/instructor/views/legacy.py
+0
-4
No files found.
lms/djangoapps/instructor/views/api.py
View file @
9861c935
...
...
@@ -40,8 +40,6 @@ import analytics.csvs
import
csv
from
bulk_email.models
import
CourseEmail
from
html_to_text
import
html_to_text
from
bulk_email
import
tasks
log
=
logging
.
getLogger
(
__name__
)
...
...
@@ -755,7 +753,7 @@ def send_email(request, course_id):
Send an email to self, staff, or everyone involved in a course.
Query Parameters:
- 'send_to' specifies what group the email should be sent to
Options are defined by the Email model in
Options are defined by the
Course
Email model in
lms/djangoapps/bulk_email/models.py
- 'subject' specifies email's subject
- 'message' specifies email's content
...
...
@@ -763,17 +761,15 @@ def send_email(request, course_id):
send_to
=
request
.
POST
.
get
(
"send_to"
)
subject
=
request
.
POST
.
get
(
"subject"
)
message
=
request
.
POST
.
get
(
"message"
)
text_message
=
html_to_text
(
message
)
email
=
CourseEmail
(
course_id
=
course_id
,
sender
=
request
.
user
,
to_option
=
send_to
,
subject
=
subject
,
html_message
=
message
,
text_message
=
text_message
,
)
email
.
save
()
tasks
.
delegate_email_batches
.
delay
(
email
.
id
,
request
.
user
.
id
)
# pylint: disable=E1101
# Create the CourseEmail object. This is saved immediately, so that
# any transaction that has been pending up to this point will also be
# committed.
email
=
CourseEmail
.
create
(
course_id
,
request
.
user
,
send_to
,
subject
,
message
)
# Submit the task, so that the correct InstructorTask object gets created (for monitoring purposes)
instructor_task
.
api
.
submit_bulk_course_email
(
request
,
course_id
,
email
.
id
)
# pylint: disable=E1101
response_payload
=
{
'course_id'
:
course_id
}
return
JsonResponse
(
response_payload
)
...
...
lms/djangoapps/instructor/views/legacy.py
View file @
9861c935
...
...
@@ -60,10 +60,6 @@ from xblock.field_data import DictFieldData
from
xblock.fields
import
ScopeIds
from
django.utils.translation
import
ugettext
as
_u
from
bulk_email.models
import
CourseEmail
from
html_to_text
import
html_to_text
from
bulk_email
import
tasks
log
=
logging
.
getLogger
(
__name__
)
# internal commands for managing forum roles:
...
...
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