コード例 #1
0
ファイル: fast_digest.py プロジェクト: xuechaos/ggrc-core
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)
コード例 #2
0
ファイル: fast_digest.py プロジェクト: google/ggrc-core
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)
コード例 #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()
コード例 #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()
コード例 #5
0
ファイル: fast_digest.py プロジェクト: google/ggrc-core
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()