Esempio n. 1
0
def present_notifications():
    """Present fast digest notifications."""
    if not rbac.permissions.is_admin():
        raise exceptions.Forbidden()
    proposals = proposal_helpers.get_email_proposal_list()
    review_notifications = review_helpers.get_review_notifications()
    generator = (u"<h1> email to {}</h1>\n {}".format(addressee.email, body)
                 for addressee, body in build_address_body(
                     proposals, review_notifications))
    return u"".join(generator)
Esempio n. 2
0
def present_notifications():
  """Present fast digest notifications."""
  if not rbac.permissions.is_admin():
    raise exceptions.Forbidden()
  proposals = proposal_helpers.get_email_proposal_list()
  review_notifications = review_helpers.get_review_notifications()
  generator = (
      u"<h1> email to {}</h1>\n {}".format(addressee.email, body)
      for addressee, body in build_address_body(proposals,
                                                review_notifications)
  )
  return u"".join(generator)
Esempio n. 3
0
def send_notification():
    """Send notifications about proposals."""
    proposals = get_email_proposal_list()
    review_notifications = get_review_notifications()
    for addressee, html in build_address_body(proposals, review_notifications):
        mail.send_mail(
            sender=getattr(settings, "APPENGINE_EMAIL"),
            to=addressee.email,
            subject=DIGEST_TITLE,
            body="",
            html=html,
        )
    mark_proposals_sent(proposals)
    move_notifications_to_history(review_notifications)
    db.session.commit()
Esempio n. 4
0
def send_notification():
    """Send notifications about proposals."""
    proposals = proposal_helpers.get_email_proposal_list()
    review_notifications = review_helpers.get_review_notifications()
    subject = build_subject()
    for addressee, html in build_address_body(proposals, review_notifications):
        notif_common.send_email(
            user_email=addressee.email,
            subject=subject,
            body=html,
        )

    proposal_helpers.mark_proposals_sent(proposals)
    review_helpers.move_notifications_to_history(review_notifications)
    db.session.commit()
Esempio n. 5
0
def send_notification():
  """Send notifications about proposals."""
  proposals = proposal_helpers.get_email_proposal_list()
  review_notifications = review_helpers.get_review_notifications()
  subject = build_subject()
  for addressee, html in build_address_body(proposals,
                                            review_notifications):
    mail.send_mail(
        sender=getattr(settings, "APPENGINE_EMAIL"),
        to=addressee.email,
        subject=subject,
        body="",
        html=html,
    )
  proposal_helpers.mark_proposals_sent(proposals)
  review_helpers.move_notifications_to_history(review_notifications)
  db.session.commit()