Ejemplo n.º 1
0
def notify_service(notify_db, notify_db_session):
    user = create_user()
    service = Service.query.get(current_app.config['NOTIFY_SERVICE_ID'])
    if not service:
        service = Service(
            name='Notify Service',
            message_limit=1000,
            restricted=False,
            email_from='notify.service',
            created_by=user,
            prefix_sms=False,
        )
        dao_create_service(service=service,
                           service_id=current_app.config['NOTIFY_SERVICE_ID'],
                           user=user)

        data = {
            'service': service,
            'email_address': "*****@*****.**",
            'is_default': True,
        }
        reply_to = ServiceEmailReplyTo(**data)

        db.session.add(reply_to)
        db.session.commit()

    return service, user
Ejemplo n.º 2
0
def create_reply_to_email(service, email_address, is_default=True):
    data = {
        'service': service,
        'email_address': email_address,
        'is_default': is_default,
    }
    reply_to = ServiceEmailReplyTo(**data)

    db.session.add(reply_to)
    db.session.commit()

    return reply_to
Ejemplo n.º 3
0
def add_reply_to_email_address_for_service(service_id, email_address,
                                           is_default):
    old_default = _get_existing_default(service_id)
    if is_default:
        _reset_old_default_to_false(old_default)
    else:
        _raise_when_no_default(old_default)

    new_reply_to = ServiceEmailReplyTo(service_id=service_id,
                                       email_address=email_address,
                                       is_default=is_default)
    db.session.add(new_reply_to)
    return new_reply_to
Ejemplo n.º 4
0
def create_reply_to_email(service,
                          email_address,
                          is_default=True,
                          archived=False):
    data = {
        "service": service,
        "email_address": email_address,
        "is_default": is_default,
        "archived": archived,
    }
    reply_to = ServiceEmailReplyTo(**data)

    db.session.add(reply_to)
    db.session.commit()

    return reply_to