Update atst to atat

This commit is contained in:
leigh-mil
2020-02-28 16:01:45 -05:00
parent 6eb48239cf
commit c2814416fb
215 changed files with 735 additions and 746 deletions

View File

@@ -0,0 +1,17 @@
from sqlalchemy import select
from atat.jobs import send_notification_mail
from atat.database import db
from atat.models.notification_recipient import NotificationRecipient
class NotificationSender(object):
EMAIL_SUBJECT = "ATAT notification"
def send(self, body, type_=None):
recipients = self._get_recipients(type_)
send_notification_mail.delay(recipients, self.EMAIL_SUBJECT, body)
def _get_recipients(self, type_):
query = select([NotificationRecipient.email])
return db.session.execute(query).fetchone()