Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
5ae7334b
Commit
5ae7334b
authored
13 years ago
by
Piotr Mitros
Browse files
Options
Downloads
Patches
Plain Diff
Extract email list from DB
parent
04ebd383
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
student/management/commands/emaillist.py
+26
-0
26 additions, 0 deletions
student/management/commands/emaillist.py
with
26 additions
and
0 deletions
student/management/commands/emaillist.py
0 → 100644
+
26
−
0
View file @
5ae7334b
import
os.path
from
lxml
import
etree
from
django.core.management.base
import
BaseCommand
from
django.conf
import
settings
from
django.contrib.auth.models
import
User
import
mitxmako.middleware
as
middleware
middleware
.
MakoMiddleware
()
class
Command
(
BaseCommand
):
help
=
\
'''
Sends an e-mail to all users. Takes a single
parameter -- name of e-mail template -- located
in templates/email. Adds a .txt for the message
body, and an _subject.txt for the subject.
'''
def
handle
(
self
,
*
args
,
**
options
):
#text = open(args[0]).read()
#subject = open(args[1]).read()
users
=
User
.
objects
.
all
()
for
user
in
users
:
if
user
.
is_active
:
print
user
.
email
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment