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

want email notifications for group feed | Forum

Ash
Ash Aug 13 '20
Hi All


is there a plugin or any trick were i can send email notifications to group users of the group feed?


Thanks in advance

Cheers!

Marcus
Marcus Aug 13 '20
bind to group add comment event
dave Leader
dave Aug 13 '20

Ash marcus is talking about the event listener.   Its in the classes folder.   At the bottom of that file should be all the events listed (sometimes they are listed at the top), i always put mine on the bottom.


But anyway those bindings are for events, when an event happens the listener sees it and it executes the function listed at the end of the code line.  That function is on the same page somewhere.


So what marcus is saying is that it has to be custom coding.

The Forum post is edited by dave Aug 13 '20
Ash
Ash Aug 14 '20
Quote from dave

Ash marcus is talking about the event listener.   Its in the classes folder.   At the bottom of that file should be all the events listed (sometimes they are listed at the top), i always put mine on the bottom.


But anyway those bindings are for events, when an event happens the listener sees it and it executes the function listed at the end of the code line.  That function is on the same page somewhere.


So what marcus is saying is that it has to be custom coding.

Thanks sir for the kind explanation. So i got the clarity that it is possible by custom coding.
Ash
Ash Aug 14 '20
Quote from Marcus bind to group add comment event
Thanks Marcus. Will connect you in pvt if i need help on this.
Marcus
Marcus Aug 14 '20
Dave is right i meant to say that if user tries to post someting in group newsfeed that prossess will trigger certain event that u can intercept or listen for. 
Ash
Ash Sep 16 '20
Hi

can anyone please guide me how to do this? i want group's activity to be notified to group members and i want the "Group Name" in the subject mail so that they re-collect, 

just like facebook! 


Also if member quits the group then the said groups notifications should also stop.!


what codes i will need to tweak in which file? 


Look forward for help, 

Thanks in advance

Cheers!

dave Leader
dave Sep 16 '20
I believe the group notification is up to the group member, some members  may not want to be notified.  Yes this is custom coding and i am not sure how to do this, if i have time this week i can look into it.
dave Leader
dave Sep 16 '20
Topic was moved from General Questions.
Ash
Ash Sep 17 '20
S
Quote from dave I believe the group notification is up to the group member, some members  may not want to be notified.  Yes this is custom coding and i am not sure how to do this, if i have time this week i can look into it.
Thanks for your support, do please look on this.


Hi All - If any other developers can help me do this, i am surprised why this was not discussed earlier, its a very basic from engagement and visibility standpoint

khalil
khalil Oct 7 '20
i can d your custom code ,i'am expert developper in oxwall contact me if you still intersting 
Ash
Ash Oct 7 '20

Quote from khalil i can d your custom code ,i'am expert developper in oxwall contact me if you still intersting 
Hi Khalil, Marcus is helping me out for this, thanks for the response :) 
Daniel
Daniel Jan 18 '21
Hi, I am looking to create notifications and emails in the Events plugin. Currently notifications are created when you invite someone to an event or when you comment on the wall. I am looking to create notifications and email when someone accepts the invitation to attend. Is anyone able to help?
dave Leader
dave Jan 18 '21

Hi,


in the classes/invitation handler  file of the event plugin look at the very bottom  and you will see a bind code like this


 OW::getEventManager()->bind('invitations.on_command', array($this, 'onCommand'));


Then scroll up and find that function called onCommand. 


The best thing to do is to make your own function and bind it just like they did and just set up your email code and insert the email address if it is part of the params array.


So to find your own function you just copy their code and put your function in it


like so


 OW::getEventManager()->bind('invitations.on_command', array($this, 'YOUR FUNCTION NAME HERE'));


so for example (i made up the function name i hope it does not already exist, you can call it whatever you want)


OW::getEventManager()->bind('invitations.on_command', array($this, 'sendUserEmail'));


Then make your function somewhere above the init() area


Something like this, all i did was copy the first part of the onCommand function as its the same for pretty much all of them and its a standard beginning


public function sendUserEmail(OW_Event $event)

{


        //make sure they are logged in

        if ( !OW::getUser()->isAuthenticated() )
        {
            return 'auth faild';
        }

        $params = $event->getParams();

        if ( !in_array($params['command'], array('events.accept', 'events.ignore')) )
        {
            return 'wrong command';
        }

      //email process goes here 



}//close function sendUserEmail


so now youll have to figure out the email part, first youll have to look at the $params array to see whats in there, their email could be part of it, if not youll  have to go get it from the user data.


Once you have that then you can either call the oxwall core email function process or code your own php mail send code which is pretty simple.


I did not notice any code in the onCommand function which shows which option they chose, accept deny but im tired so i could have missed it.


But once you copy that into your function then just do the email process and done...


I hope this helps you...  :)


ps please start a new topic next time ok thanks  :)



The Forum post is edited by dave Jan 18 '21
Daniel
Daniel Jan 18 '21
Thanks Dave, very helpful.

Do you also know how to get the notification showing on the notification icon within the console?

dave Leader
dave Jan 18 '21

yes look inside the video plugin you have of mine  controllers/vidaction.php


line 1573 is an example...   hope that helps..





Daniel
Daniel Jan 18 '21
Thanks again Dave, that is very helpful.

On line 1600 the 'action' specified on your video plugin states 'video-notify' 


For the events plugin do you know what 'action' should be stated? 

dave Leader
dave Jan 19 '21
i think its event-invitation
dave Leader
dave Jan 19 '21
if i remember correctly its just a language key value so you can check the key in language and see if its there