We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Notifications by email every 7 days instead of 2 | Forum

Patricia Zorrilla Leader
Patricia Zorrilla Jan 25 '17

Notifications by email every 7 days instead of 2

How can I change the frequency of notifications?

In version 1.84 I made these changes in:

Ow_plugins / notifications / cron.php

    public function fillSendQueue()

    {

        if ( $this->service->getSendQueueLength() == 0 )

        {

// Patri modif

//            $this->service->fillSendQueue(24 * 3600);

            $this->service->fillSendQueue(24 * 3600 * 7);

// End Patri modif

        }

    }


    public function run()

    {

// Patri modif

//        $users = $this->service->findUserIdListForSend(100);

        $users = $this->service->findUserIdListForSend(50);

// End Patri modif


        if ( empty($users) )

        {

            return;

        }


        $listEvent = new BASE_CLASS_EventCollector('notifications.send_list', array(

            'userIdList' => $users

        ));


        OW::getEventManager()->trigger($listEvent);


        $notifications = array();

        foreach ( $listEvent->getData() as $notification )

        {

            $itemEvent = new OW_Event('notifications.on_item_send', $notification, $notification['data']);

            OW::getEventManager()->trigger($itemEvent);


            $notification['data'] = $itemEvent->getData();


            $notifications[$notification['userId']][] = $notification;

        }


        foreach ( $notifications as $userId => $notificationList )

        {

            $this->service->sendPermittedNotifications($userId, $notificationList);

        }

    }


but it does not work. any ideas?

Activating debug and other mode is already done, but continue sending every other day.

The Forum post is edited by Patricia Zorrilla Jan 25 '17