def build_streams_notification_message(env, events, action_type='FIRE'):
    message = None
    if len(events) > 0:
        stream_name = stream_helpers.stream_def_name(env['stream_name'])
        tenant_id = events[0]['_tenant_id']
        streams_repo = StreamsRepository()
        stream_definition_rows = (
            streams_repo.get_stream_definitions(
                tenant_id, stream_name))
        for row in stream_definition_rows:
            if action_type.upper() == 'FIRE':
                action_id = row['fire_actions']
            else:
                action_id = row['expire_actions']
            message = {'tenant_id': tenant_id,
                       'stream_def': {
                           'name': stream_name,
                           'id': row['id'],
                           'description': row['description'],
                           'actions_enabled': row['actions_enabled'],
                           'action_type': action_type,
                           'action_id': action_id},
                       'events': []}
            for e in events:
                message['events'].append(e)
    return message