Beispiel #1
0
def new_account_notification(user):
    """
    Account creation notification.
    """
    plaintext = """Hello,\n\nYour account has been created. Click on the following link to confirm it:\n%s\n\nSee you,""" % \
                        (conf.PLATFORM_URL + 'user/confirm_account/' + user.activation_key)
    emails.send(to=user.email, bcc=conf.NOTIFICATION_EMAIL,
                subject="[jarr] Account creation", plaintext=plaintext)
Beispiel #2
0
def new_account_activation(user):
    """
    Account activation notification.
    """
    plaintext = """Hello,\n\nYour account has been activated. You can now connect to the platform:\n%s\n\nSee you,""" % \
                        (conf.PLATFORM_URL)
    emails.send(to=user.email, bcc=conf.NOTIFICATION_EMAIL,
                subject="[jarr] Account activated", plaintext=plaintext)
Beispiel #3
0
def new_password_notification(user, password):
    """
    New password notification.
    """
    plaintext = """Hello,\n\nA new password has been generated at your request:\n\n%s""" % \
                        (password, )
    plaintext += "\n\nIt is advised to replace it as soon as connected to jarr.\n\nSee you,"
    emails.send(to=user.email,
                bcc=conf.NOTIFICATION_EMAIL,
                subject="[jarr]  New password", plaintext=plaintext)
Beispiel #4
0
def new_account_activation(user):
    """
    Account activation notification.
    """
    plaintext = """Hello,\n\nYour account has been activated. You can now connect to the platform:\n%s\n\nSee you,""" % \
                        (conf.PLATFORM_URL)
    emails.send(to=user.email,
                bcc=conf.NOTIFICATION_EMAIL,
                subject="[jarr] Account activated",
                plaintext=plaintext)
Beispiel #5
0
def new_account_notification(user):
    """
    Account creation notification.
    """
    plaintext = """Hello,\n\nYour account has been created. Click on the following link to confirm it:\n%s\n\nSee you,""" % \
                        (conf.PLATFORM_URL + 'user/confirm_account/' + user.activation_key)
    emails.send(to=user.email,
                bcc=conf.NOTIFICATION_EMAIL,
                subject="[jarr] Account creation",
                plaintext=plaintext)
Beispiel #6
0
def new_password_notification(user, password):
    """
    New password notification.
    """
    plaintext = """Hello,\n\nA new password has been generated at your request:\n\n%s""" % \
                        (password, )
    plaintext += "\n\nIt is advised to replace it as soon as connected to jarr.\n\nSee you,"
    emails.send(to=user.email,
                bcc=conf.NOTIFICATION_EMAIL,
                subject="[jarr]  New password",
                plaintext=plaintext)
Beispiel #7
0
def information_message(subject, plaintext):
    """
    Send an information message to the users of the platform.
    """
    from web.models import User
    users = User.query.all()
    # Only send email for activated accounts.
    user_emails = [user.email for user in users if user.activation_key == ""]
    # Postmark has a limit of twenty recipients per message in total.
    for i in xrange(0, len(user_emails), 19):
        emails.send(to=conf.NOTIFICATION_EMAIL,
                    bcc=", ".join(user_emails[i:i+19]),
                    subject=subject, plaintext=plaintext)
Beispiel #8
0
def information_message(subject, plaintext):
    """
    Send an information message to the users of the platform.
    """
    from web.models import User
    users = User.query.all()
    # Only send email for activated accounts.
    user_emails = [user.email for user in users if user.activation_key == ""]
    # Postmark has a limit of twenty recipients per message in total.
    for i in xrange(0, len(user_emails), 19):
        emails.send(to=conf.NOTIFICATION_EMAIL,
                    bcc=", ".join(user_emails[i:i + 19]),
                    subject=subject,
                    plaintext=plaintext)