Exemplo n.º 1
0
def announce_feedback(feedback):
    sender = DEFAULT_SENDER
    recipients = [FEEDBACK_RECIPIENT]
    subject = ""
    text = "URL: %s\nEmail: %s\nSystem info:\n%s\nComments: %s\n" % (feedback.url, feedback.email, feedback.sys_info, feedback.comments)
    try:
        log.debug("send_mail from announce_feedback to " + FEEDBACK_RECIPIENT)
        for recipient in recipients:
            add_to_mail_queue(sender, recipient, subject, text)
    except:
        log.error("Failure in announce_feedback:")
        log.trace()
Exemplo n.º 2
0
def announce_flag(request, flowgram):
    flagger = request.user.username or request.META['REMOTE_ADDR']
    subect = "%s FLAGGED by %s" % (flowgram.title, flagger)
    sender = DEFAULT_SENDER
    text = "See the flagged flowgram at %s" % flowgram.url()
    recipients = ['*****@*****.**']
    try:
        log.debug("send_mail from announce_flag to " + '*****@*****.**')
        for recipient in recipients:
            add_to_mail_queue(sender, recipient, subject, text)
    except:
        log.error("Failure in announce_flag:")
        log.trace()
Exemplo n.º 3
0
def reset_password(u):
    """Generates and sends a password-reset email for the user."""
    #Calculate secret URL:
    hash = password_reset_hash(u)
    url = URL_BASE + ("newpassword/?user=%s&key=%s" % (u.username, hash))

    #render and send the email:
    subject = "Your Flowgram.com account"
    t = loader.get_template('emails/reset_password.txt')
    c = Context({
        'recipient': u,
        'url': url,
    })
    text = t.render(c)
    try:
        email_user(u, subject, text)
    except:
        log.trace()
        return False
    return True