Warning: The author of this contribution does not provide support for it anymore.

Prime Notify

will this work with 3.1.1 ? - Prime Notify

will this work with 3.1.1 ?

by cally6008 » Tue Nov 04, 2014 4:00 pm

Will Prime Notify be updated so it becomes an Extension on 3.1.1 ?
cally6008
Registered User
Posts: 286
Joined: Wed Nov 26, 2008 10:18 pm
Contact:

Re: will this work with 3.1.1 ?

by primehalo » Wed Nov 05, 2014 5:24 pm

Hopefully eventually, but I don't have much time to work on it right now.

UPDATE
I have finished the port to a phpBB 3.1.7-PL1 MOD:
http://www.absoluteanime.com/admin/phpb ... Notify.zip

Remember, it's a MOD not an extension and so must be installed like the phpBB 3.0.x MODs which modify core files, so please backup your forum before installing. Also, You should probably test it on a non-live board first just to make sure it works with your setup.

I'd like to thank Mankind Project Germany for helping me to get this port made more quickly than it would have been.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
User avatar
primehalo
Former Team Member
Posts: 2855
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: will this work with 3.1.1 ?

by Martin Day » Fri Nov 21, 2014 7:19 pm

I'll be ready to implement it again when you do, Ken.
Thanks, Martin Day
Martin
User avatar
Martin Day
Registered User
Posts: 59
Joined: Fri Nov 28, 2008 8:39 pm
Location: Woking, UK
Contact:

Re: will this work with 3.1.1 ?

by primehalo » Fri Nov 21, 2014 11:29 pm

I've been looking into it, but currently it does not seem possible to implement. The main hurdles I see are that I need to be able to add template variables to use in the email template and to load my custom email template file instead of the default one. Both of these events, loading the template and assigning variables, take place in phpbb\notificaion\method\messenger_base.php:

Code: Select all

        $messenger = new \messenger();
        
// Time to go through the queue and send emails
        
foreach ($this->queue as $notification)
        {
            
// ...
            
$messenger->template($notification->get_email_template(), ...);
            
// ...
            
$messenger->assign_vars(array_merge(array(
                
'USERNAME'                        => $user['username'],
                
// ...
            
), $notification->get_email_template_variables()));
            
$messenger->send($notify_method);
        }
          

There are no events there that I can hook into. Unless I'm overlooking something, I believe event listeners would need to be added here in order to accomplish what I need. I know it's possible to request for new ones to be added, but according to this post:
http://area51.phpbb.com/phpBB/viewtopic ... 91#p271191
I'd have to not just make a post for the request detailing exactly what I need and why I need it, but also create an associated ticket in the tracker, which all just sounds like a lot of work. Too much work to do right now anyway. You think maybe if we wait long enough somebody else will also need the same thing and they will fill out the request?
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
User avatar
primehalo
Former Team Member
Posts: 2855
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: will this work with 3.1.1 ?

by Martin Day » Sat Nov 22, 2014 5:33 pm

Thanks for the reply and for giving it some thought, Ken. Like someone else, said Prime Notify is really good enough (and elegant enough) to be part of the standard offering. If you do find the time sometime I would be first in line to implement it ... until then I think I'll just hover around in the 3.0s where I can still use it :)
Martin
User avatar
Martin Day
Registered User
Posts: 59
Joined: Fri Nov 28, 2008 8:39 pm
Location: Woking, UK
Contact:

Re: will this work with 3.1.1 ?

by Komanche » Thu Feb 19, 2015 2:18 pm

+1
Komanche
Registered User
Posts: 248
Joined: Thu Aug 02, 2007 10:49 am
Location: Czech Republic
Contact:

Re: will this work with 3.1.1 ?

by manarak » Mon Apr 13, 2015 4:12 am

maybe a good first step could be a hack?
manarak
Registered User
Posts: 24
Joined: Sun Nov 21, 2010 1:01 pm
Contact:

Re: will this work with 3.1.1 ?

by cally6008 » Mon Apr 13, 2015 8:57 pm

phpbb 3.1.4 rc1 has been released and it has more events added
full event list - https://wiki.phpbb.com/Event_List

hope this helps
fingers crossed
cally6008
Registered User
Posts: 286
Joined: Wed Nov 26, 2008 10:18 pm
Contact:

Re: will this work with 3.1.1 ?

by Martin Day » Mon Apr 13, 2015 9:45 pm

cally6008 wrote:phpbb 3.1.4 rc1 has been released and it has more events added
full event list - https://wiki.phpbb.com/Event_List

hope this helps
fingers crossed

This does look promising. I wonder if 'core.acp_email_send_before' could be the event that Prime Notify needs - the explanation reads "Modify email template data before the emails are sent".

What do you think, Ken?
Martin
User avatar
Martin Day
Registered User
Posts: 59
Joined: Fri Nov 28, 2008 8:39 pm
Location: Woking, UK
Contact:

Re: will this work with 3.1.1 ?

by cally6008 » Tue May 12, 2015 9:16 pm

3.1.4 is now out
cally6008
Registered User
Posts: 286
Joined: Wed Nov 26, 2008 10:18 pm
Contact:

Re: will this work with 3.1.1 ?

by RMcGirr83 » Thu May 21, 2015 10:00 am

primehalo wrote:I've been looking into it, but currently it does not seem possible to implement. The main hurdles I see are that I need to be able to add template variables to use in the email template and to load my custom email template file instead of the default one. Both of these events, loading the template and assigning variables, take place in phpbb\notificaion\method\messenger_base.php:

Code: Select all

        $messenger = new \messenger();
        
// Time to go through the queue and send emails
        
foreach ($this->queue as $notification)
        {
            
// ...
            
$messenger->template($notification->get_email_template(), ...);
            
// ...
            
$messenger->assign_vars(array_merge(array(
                
'USERNAME'                        => $user['username'],
                
// ...
            
), $notification->get_email_template_variables()));
            
$messenger->send($notify_method);
        }
           

There are no events there that I can hook into. Unless I'm overlooking something, I believe event listeners would need to be added here in order to accomplish what I need.


posting.php has events that you can hook into using a listener that can fire and use the messenger class. You don't need to hook into the messenger class (eg, look at the add user extension).
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored
User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: will this work with 3.1.1 ?

by cally6008 » Thu May 21, 2015 3:14 pm

that sounds positive Rich, it might be an idea to drop primehalo an inbox message and let them know
cally6008
Registered User
Posts: 286
Joined: Wed Nov 26, 2008 10:18 pm
Contact:

Re: will this work with 3.1.1 ?

by RMcGirr83 » Thu May 21, 2015 3:18 pm

He probably, assuming he has visited this topic when you made your post before mine, got that there is a new message in his email....just as I did for yours.

I don't PM users needlessly as I don't like getting those myself.
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored
User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: will this work with 3.1.1 ?

by javiexin » Fri May 22, 2015 6:12 pm

Alternatively, this could be implemented as new notification classes that would "inherit" from the standard post and pm notifications and would add this functionality of sending the complete text in the notification email, possibly if the user has configured it in the UCP. Using a notification.yml file in the extension could tell the core of phpbb to use the new class instead of the standard, achieving the same result without using any events (or almost, as I have not checked thoroughly).
User avatar
javiexin
Code Contributor
Posts: 1157
Joined: Wed Oct 12, 2011 11:46 pm
Location: Madrid, Spain
Name: Javier
Contact:

Re: will this work with 3.1.1 ?

by CarolC1 » Tue Jun 02, 2015 12:53 am

Not being able to have this feature is half the reason we have not converted from 3.0.x.

With over 5000 downloads of this mod, there must be a lot of other boards that want it for an extension, too.

:)
CarolC1
Registered User
Posts: 572
Joined: Sat Dec 02, 2006 4:26 pm