root / flowspec / helpers.py @ b436bd51
History | View | Annotate | Download (748 Bytes)
1 |
from django.core.mail.message import EmailMessage |
---|---|
2 |
from django.conf import settings |
3 |
|
4 |
|
5 |
def send_new_mail(subject, message, from_email, recipient_list, bcc_list): |
6 |
return EmailMessage(subject, message, from_email, recipient_list, bcc_list).send()
|
7 |
|
8 |
|
9 |
def get_peer_techc_mails(user): |
10 |
mail = [] |
11 |
additional_mail = [] |
12 |
techmails_list = [] |
13 |
user_mail = '%s' % user.email
|
14 |
user_mail = user_mail.split(';')
|
15 |
techmails = user.get_profile().peer.techc_emails.all() |
16 |
if techmails:
|
17 |
for techmail in techmails: |
18 |
techmails_list.append(techmail.email) |
19 |
if settings.NOTIFY_ADMIN_MAILS:
|
20 |
additional_mail = settings.NOTIFY_ADMIN_MAILS |
21 |
mail.extend(additional_mail) |
22 |
mail.extend(techmails_list) |
23 |
return mail
|