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
a0217b73
Commit
a0217b73
authored
May 04, 2015
by
Chris Dodge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tweeks getting digests to work in mcka
parent
e55d85a6
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
64 additions
and
11 deletions
+64
-11
common/djangoapps/student/management/commands/force_send_notification_digest.py
+2
-2
common/djangoapps/student/scope_resolver.py
+18
-4
lms/envs/aws.py
+37
-4
lms/envs/common.py
+6
-0
lms/envs/devstack.py
+1
-1
No files found.
common/djangoapps/student/management/commands/force_send_notification_digest.py
View file @
a0217b73
...
...
@@ -81,7 +81,7 @@ class Command(BaseCommand):
to_timestamp
=
datetime
.
datetime
.
now
(
pytz
.
UTC
)
preference_name
=
const
.
NOTIFICATION_DAILY_DIGEST_PREFERENCE_NAME
subject
=
const
.
NOTIFICATION_DAILY_DIGEST_SUBJECT
from_email
=
const
.
NOTIFICATION_
DIGEST
_FROM_ADDRESS
from_email
=
const
.
NOTIFICATION_
EMAIL
_FROM_ADDRESS
if
namespace
==
"All"
:
digests_sent
=
send_notifications_digest
(
from_timestamp
,
to_timestamp
,
preference_name
,
subject
,
from_email
)
...
...
@@ -99,7 +99,7 @@ class Command(BaseCommand):
to_timestamp
=
datetime
.
datetime
.
now
(
pytz
.
UTC
)
preference_name
=
const
.
NOTIFICATION_WEEKLY_DIGEST_PREFERENCE_NAME
subject
=
const
.
NOTIFICATION_WEEKLY_DIGEST_SUBJECT
from_email
=
const
.
NOTIFICATION_
DIGEST
_FROM_ADDRESS
from_email
=
const
.
NOTIFICATION_
EMAIL
_FROM_ADDRESS
if
namespace
==
"All"
:
digests_sent
=
send_notifications_digest
(
from_timestamp
,
to_timestamp
,
preference_name
,
subject
,
from_email
)
...
...
common/djangoapps/student/scope_resolver.py
View file @
a0217b73
...
...
@@ -106,7 +106,7 @@ class NamespaceEnrollmentsScopeResolver(NotificationUserScopeResolver):
if
scope_context
[
'fields'
]
.
get
(
'last_name'
):
fields
.
append
(
'last_name'
)
else
:
fields
=
[
'id'
,
'email'
,
'first_name'
,
'last_name'
]
fields
=
[
'id'
,
'email'
,
'first_name'
,
'last_name'
]
query
=
query
.
values
(
*
fields
)
query
=
query
.
filter
(
...
...
@@ -135,6 +135,20 @@ class StudentEmailScopeResolver(NotificationUserScopeResolver):
if
not
user_id
:
return
None
return
User
.
objects
.
values_list
(
'email'
,
flat
=
True
)
.
filter
(
id
=
user_id
)
if
'fields'
in
scope_context
:
fields
=
[]
if
scope_context
[
'fields'
]
.
get
(
'id'
):
fields
.
append
(
'id'
)
if
scope_context
[
'fields'
]
.
get
(
'email'
):
fields
.
append
(
'email'
)
if
scope_context
[
'fields'
]
.
get
(
'first_name'
):
fields
.
append
(
'first_name'
)
if
scope_context
[
'fields'
]
.
get
(
'last_name'
):
fields
.
append
(
'last_name'
)
else
:
fields
=
[
'id'
,
'email'
,
'first_name'
,
'last_name'
]
return
User
.
objects
.
values
(
*
fields
)
.
filter
(
id
=
user_id
)
lms/envs/aws.py
View file @
a0217b73
...
...
@@ -565,13 +565,46 @@ MIDDLEWARE_CLASSES = tuple(_class for _class in MIDDLEWARE_CLASSES if _class not
##### EDX-NOTIFICATIONS ######
NOTIFICATION_CLICK_LINK_URL_MAPS
=
ENV_TOKENS
.
get
(
'NOTIFICATION_CLICK_LINK_URL_MAPS'
,
NOTIFICATION_CLICK_LINK_URL_MAPS
)
NOTIFICATION_STORE_PROVIDER
=
ENV_TOKENS
.
get
(
'NOTIFICATION_STORE_PROVIDER'
,
NOTIFICATION_STORE_PROVIDER
)
NOTIFICATION_CHANNEL_PROVIDERS
=
ENV_TOKENS
.
get
(
'NOTIFICATION_CHANNEL_PROVIDERS'
,
NOTIFICATION_CHANNEL_PROVIDERS
)
NOTIFICATION_CLICK_LINK_URL_MAPS
=
ENV_TOKENS
.
get
(
'NOTIFICATION_CLICK_LINK_URL_MAPS'
,
NOTIFICATION_CLICK_LINK_URL_MAPS
)
NOTIFICATION_STORE_PROVIDER
=
ENV_TOKENS
.
get
(
'NOTIFICATION_STORE_PROVIDER'
,
NOTIFICATION_STORE_PROVIDER
)
NOTIFICATION_CHANNEL_PROVIDERS
=
ENV_TOKENS
.
get
(
'NOTIFICATION_CHANNEL_PROVIDERS'
,
NOTIFICATION_CHANNEL_PROVIDERS
)
NOTIFICATION_CHANNEL_PROVIDER_TYPE_MAPS
=
ENV_TOKENS
.
get
(
'NOTIFICATION_CHANNEL_PROVIDER_TYPE_MAPS'
,
NOTIFICATION_CHANNEL_PROVIDER_TYPE_MAPS
)
NOTIFICATION_MAX_LIST_SIZE
=
ENV_TOKENS
.
get
(
'NOTIFICATION_MAX_LIST_SIZE'
,
NOTIFICATION_MAX_LIST_SIZE
)
NOTIFICATION_MAX_LIST_SIZE
=
ENV_TOKENS
.
get
(
'NOTIFICATION_MAX_LIST_SIZE'
,
NOTIFICATION_MAX_LIST_SIZE
)
NOTIFICATION_DAILY_DIGEST_SUBJECT
=
ENV_TOKENS
.
get
(
'NOTIFICATION_DAILY_DIGEST_SUBJECT'
,
NOTIFICATION_DAILY_DIGEST_SUBJECT
)
NOTIFICATION_WEEKLY_DIGEST_SUBJECT
=
ENV_TOKENS
.
get
(
'NOTIFICATION_WEEKLY_DIGEST_SUBJECT'
,
NOTIFICATION_WEEKLY_DIGEST_SUBJECT
)
NOTIFICATION_BRANDED_DEFAULT_LOGO
=
ENV_TOKENS
.
get
(
'NOTIFICATION_BRANDED_DEFAULT_LOGO'
,
NOTIFICATION_BRANDED_DEFAULT_LOGO
)
NOTIFICATION_EMAIL_FROM_ADDRESS
=
ENV_TOKENS
.
get
(
'NOTIFICATION_EMAIL_FROM_ADDRESS'
,
NOTIFICATION_EMAIL_FROM_ADDRESS
)
NOTIFICATION_EMAIL_CLICK_LINK_ROOT
=
ENV_TOKENS
.
get
(
'NOTIFICATION_EMAIL_CLICK_LINK_ROOT'
,
NOTIFICATION_EMAIL_CLICK_LINK_ROOT
)
XBLOCK_SETTINGS
=
ENV_TOKENS
.
get
(
'XBLOCK_SETTINGS'
,
{})
lms/envs/common.py
View file @
a0217b73
...
...
@@ -2100,6 +2100,12 @@ NOTIFICATION_CHANNEL_PROVIDER_TYPE_MAPS = {
'*'
:
'durable'
,
# default global mapping
}
NOTIFICATION_DAILY_DIGEST_SUBJECT
=
"Your dialy digest of Notifications from Open edX"
NOTIFICATION_WEEKLY_DIGEST_SUBJECT
=
"Your weekly digest of Notifications from Open edX"
NOTIFICATION_BRANDED_DEFAULT_LOGO
=
'edx_notifications/img/edx-openedx-logo-tag.png'
NOTIFICATION_EMAIL_FROM_ADDRESS
=
''
NOTIFICATION_EMAIL_CLICK_LINK_ROOT
=
'http://localhost'
# Country code overrides
# Used by django-countries
COUNTRIES_OVERRIDE
=
{
...
...
lms/envs/devstack.py
View file @
a0217b73
...
...
@@ -27,7 +27,7 @@ for pkg_name in ['track.contexts', 'track.middleware', 'dd.dogapi']:
################################ EMAIL ########################################
EMAIL_BACKEND
=
'django.core.mail.backends.console.EmailBackend'
#
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
FEATURES
[
'ENABLE_INSTRUCTOR_EMAIL'
]
=
True
# Enable email for all Studio courses
FEATURES
[
'REQUIRE_COURSE_EMAIL_AUTH'
]
=
False
# Give all courses email (don't require django-admin perms)
...
...
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