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

How to make email notification immediately as default [Solution Available] | Forum

ben
ben Apr 22 '13
Hello , How to make email notification set to immediately as default? If set to automatically how long user get email notification?
The Forum post is edited by Alia Jul 11 '14
Alia Team
Alia Apr 24 '13
/ow_plugins/notifications/bol/service.php

    public function getDefaultSchedule()
    {
        return self::SCHEDULE_AUTO;
    }

Alia Team
Alia Apr 24 '13
Topic was moved from General Questions.
ben
ben Apr 24 '13
thank you mam, i feels like releasing thousands pending email :D. can I ask once more? how to make users subscribed forum as default when they reply forum topic they also automatically subscribe the topic?
Daisy Team
Daisy May 3 '13
Yes, you can easily do that. All you need is using the subscribeTopic method in this file: ow_plugins/forum/controllers/topic.php
ben
ben May 3 '13
sorry, cant find the code, it's too complicated for me :D

I mean if they reply to topic they also subcribe that topic as default, they dont have to tick the subcribe box.

if ( OW::getUser()->isAuthorized('forum', 'subscribe') && !$subscribeService->isUserSubscribed($userId, $topicId) )



Daisy Team
Daisy May 6 '13
Ben, sorry, I've given you the directions, but this is all I can do. I cannot give you the step-by-step instructions on how to make this modification.
ben
ben May 8 '13
Never mind, Thanks Daisy


Daisy Team
Daisy May 14 '13
You are welcome.
Daniel Kumitz
Daniel Kumitz Jun 17 '13
Hi Alia,

thanks for all your helpful information. I have two follow-up questions:

1) assuming that

return self::SCHEDULE_AUTO;

refers to automatic response, which would the code be for immediate response?

2) And: do I just add the above code to the service.php file? I did not find equivalent code to replace.

Cheers
Daniel
Chris
Chris Jun 18 '13
I second Daniel Kumitz question. Finding and changing the code is pretty simple, but what is the correct code for immediate response?
Daisy Team
Daisy Jun 19 '13
Guys,

You can see the following strings at the beginning of the file:

const SCHEDULE_IMMEDIATELY = 'immediately';
const SCHEDULE_AUTO = 'auto';
const SCHEDULE_NEVER = 'never';


You should choose the constant you need to set as default and then change the SCHEDULE_AUTO constant to the chosen one in the function Aliia mentioned.

Kumi Festus
Kumi Festus Jun 19 '13
This is the function default

public function getDefaultSchedule()
    {
        return self::SCHEDULE_AUTO;

I changed to 

public function getDefaultSchedule()
    {
        return self::SCHEDULE_IMMEDIATELY;
The site jammed, I had to change it back to _AUTO.
Is there something I am missing?
Daisy Team
Daisy Jun 20 '13
Everything should work. Please enable the DEBUG_MOD to see the error that occurs when you change the value to SCHEDULE_IMMEDIATELY;
Saif
Saif Jun 23 '13
Working fine for my website... But i wish "AUTO " could work for me.
Daisy Team
Daisy Jun 24 '13
Sorry, but it's not quite clear. Could you provide us with more details.
S. Bourdon
S. Bourdon Jul 11 '13
Quote from ben   if they reply to topic they also subcribe that topic as default, they dont have to tick the subcribe box.

Here's what I did.


Open oxwall\ow_plugins\forum\init.php


After the following lines:

        $event = new OW_Event('notifications.add', $params, $data);

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

    }


Add this code:

    $subscribeService = FORUM_BOL_SubscriptionService::getInstance();

    $userId = OW::getUser()->getId();

    $topicId = $post->topicId;


    if ( OW::getUser()->isAuthorized('forum', 'subscribe') && !$subscribeService->isUserSubscribed($userId, $topicId) )

    {

        $subscription = new FORUM_BOL_Subscription;

        $subscription->userId = $userId;

        $subscription->topicId = $topicId;


        $subscribeService->addSubscription($subscription);

    }



Hope this helps!  :)


ben
ben Jul 18 '13
thanks for sharing
Bekir Eyiengin
Bekir Eyiengin Jul 19 '13
I set the schedule to "Immediately" as shown above. Automatically won't work on my site. So I want to delete the radio button "Automatically" on the email-notifications settings page. User shall only choose between Immediately and Never (on and off).



But in the view file "(...)oxwall/ow_plugins/notifications/views/controllers/notifications_settings.html" the code reads like this:

<tr class="ow_alt1">
            <td class="ow_value">{input name="schedule"}</td>
        </tr>

How can I delete the selection for automatically? Anyone an idea? Thanks!
Daisy Team
Daisy Jul 22 '13
You can make changes via this file /ow_plugins/notifications/bol/service.php
Pages: 1 2 »