Ejemplo n.º 1
0
def send_email(messages, multi):
    if multi:
        with mail.connect() as conn:
            for message in messages:
                conn.send(message)
    else:
        mail.send(messages)
def new_contract_autoupdate(contract, sender):
    '''Bulk mails all users following a contract with information about their new contract
    '''
    msg_body = render_template('conductor/emails/new_contract.html', contract=contract)

    with mail.connect() as conn:
        for user in contract.followers:
            msg = Message(
                subject='[Pittsburgh Procurement] A contract you follow has been updated!',
                html=msg_body,
                sender=sender,
                recipients=[user.email]
            )

            conn.send(msg)
def new_contract_autoupdate(contract, sender):
    '''Bulk mails all users following a contract with information about their new contract
    '''
    msg_body = render_template('conductor/emails/new_contract.html',
                               contract=contract)

    with mail.connect() as conn:
        for user in contract.followers:
            msg = Message(
                subject=
                '[Pittsburgh Procurement] A contract you follow has been updated!',
                html=msg_body,
                sender=sender,
                recipients=[user.email])

            conn.send(msg)
def send_email(messages):
    with mail.connect() as conn:
        for message in messages:
            conn.send(message)
Ejemplo n.º 5
0
def send_email(messages):
    with mail.connect() as conn:
        for message in messages:
            conn.send(message)