示例#1
0
文件: models.py 项目: svoigt/lernanta
def post_notification_response(token, user, text):
    """ create response task and run asynchronously """

    if _auto_response_filter(token, text):
        subject_template = 'notifications/emails/response_bounce_subject.txt'
        body_template = 'notifications/emails/response_bounce.txt'
        context = { 'original_message': text }
        send_notifications_i18n([user], subject_template, body_template, context)
        log.debug('post_notification_response: quick response bounced')
        return

    args = (token, user, text,)
    PostNotificationResponse.apply_async(args)
示例#2
0
文件: models.py 项目: mkcode/lernanta
def post_notification_response(token, user, text):
    """ create response task and run asynchronously """

    if _auto_response_filter(token, text):
        subject_template = 'notifications/emails/response_bounce_subject.txt'
        body_template = 'notifications/emails/response_bounce.txt'
        context = { 'original_message': text }
        send_notifications([user], subject_template, body_template, context)
        log.debug('post_notification_response: quick response bounced')
        statsd.Statsd.increment('auto-replies')
        return

    args = (token, user, text,)
    PostNotificationResponse.apply_async(args)
示例#3
0
文件: models.py 项目: josmas/lernanta
def post_notification_response(token, from_email, text):
    args = (token, from_email, text,)
    PostNotificationResponse.apply_async(args)