def store_emails(recipient_ids, notification_type, event, user, node, timestamp, **context):
 if (notification_type == 'none'):
  return
 template = (event + '.html.mako')
 context['user'] = user
 node_lineage_ids = (get_node_lineage(node) if node else [])
 for user_id in recipient_ids:
  if (user_id == user._id):
   continue
  recipient = OSFUser.load(user_id)
  context['localized_timestamp'] = localize_timestamp(timestamp, recipient)
  message = mails.render_message(template, **context)
  digest = NotificationDigest(timestamp=timestamp, send_type=notification_type, event=event, user=recipient, message=message, node_lineage=node_lineage_ids)
  digest.save()

def store_emails ( recipient_ids , notification_type , event , user , node , timestamp , ** context ) : if ( notification_type == 'none' ) : return template = ( event + '.html.mako' ) context [ 'user' ] = user node_lineage_ids = ( get_node_lineage ( node ) if node else [ ] ) for user_id in recipient_ids : if ( user_id == user . _id ) : continue recipient = OSFUser . load ( user_id ) context [ 'localized_timestamp' ] = localize_timestamp ( timestamp , recipient ) message = mails . render_message ( template , ** context ) digest = NotificationDigest ( timestamp = timestamp , send_type = notification_type , event = event , user = recipient , message = message , node_lineage = node_lineage_ids ) digest . save ( )
store notification emails emails are sent via celery beat as digests .