Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Merge branch 'master' of https://github.com/pythonindia/wye
Conflicts: wye/templates/profile/index.html
- Loading branch information
Showing
34 changed files
with
776 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,3 +83,11 @@ node_modules/ | |
|
||
#Sourcemap files | ||
*.map | ||
|
||
# VIM | ||
[._]*.s[a-w][a-z] | ||
[._]s[a-w][a-z] | ||
*.un~ | ||
Session.vim | ||
.netrwhist | ||
*~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import threading | ||
|
||
from django.conf import settings | ||
from django.core.mail import EmailMultiAlternatives | ||
|
||
|
||
def send_email_to_list(subject, body, users_list, text_body, | ||
bcc_admins=True, bcc_managers=False): | ||
bcc = [] | ||
if bcc_admins: | ||
bcc += [email for name, email in settings.ADMINS] # @UnusedVariable | ||
|
||
if bcc_managers: | ||
bcc += [email for name, email in settings.MANAGERS] # @UnusedVariable | ||
from_user = 'PythonExpress <noreply@pythonexpress.in>' | ||
email = EmailMultiAlternatives( | ||
subject, text_body, from_user, users_list, bcc) | ||
email.attach_alternative(body, "text/html") | ||
EmailThread(email).start() | ||
|
||
|
||
def send_email_to_id(subject, body, email_id, text_body, | ||
bcc_admins=True, bcc_managers=False): | ||
bcc = [] | ||
if bcc_admins: | ||
bcc += [email for name, email in settings.ADMINS] # @UnusedVariable | ||
|
||
if bcc_managers: | ||
bcc += [email for name, email in settings.MANAGERS] # @UnusedVariable | ||
|
||
from_user = 'PythonExpress <noreply@pythonexpress.in>' | ||
email = EmailMultiAlternatives( | ||
subject, text_body, from_user, [email_id], bcc=bcc) | ||
email.attach_alternative(body, "text/html") | ||
EmailThread(email).start() | ||
|
||
|
||
class EmailThread(threading.Thread): | ||
|
||
def __init__(self, email): | ||
self.email = email | ||
threading.Thread.__init__(self) | ||
|
||
def run(self): | ||
try: | ||
self.email.send() | ||
except Exception as e: | ||
print(e) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.