Hello,
How do I send a pm to a GROUP of members using the using the sendpm() (http://support.simplemachines.org/function_db/index.php?action=view_function;id=315) function ?
Thanks,
Nosx
I just wonder why would you like to do that as SMF already have built in feature to send PM to particular group from Admin -> News and Newsletter ---> Newsletter --> Send this message as PM .
If still something you want to do through coding or custom, below is function details :
http://support.simplemachines.org/function_db/index.php?action=view_function;id=315
A.) I already know HOW to send a pm and if you noticed in my post I supplied the exact same link you did so I already knew about it.
B.) I am sending the messages at defined intervals using a CRON job and before you say to set up a task to do this then that will not work either as SMF task scheduler is not flexible enough for my needs.
C.) As I said above I already know how to send a pm to one or more members by adding their member id to the $recipients array defined in sendpim() function. All I need to know is how to set it to go to a group instead of individual members.
In other words..
$recipients = array(
'to' => array(what_do_I_need_to_put_here_to_send_to_a_group),
'bcc' => array()
);
Thx,
Nosx
Ok then.. I overlooked,
Now since you know all things apart that you can't send PM to any particular member group using this function directly rather you can query a membergroup and then save those members in $recipient array and then send PM them to all !
Hope that gives you idea.
Makes sense. Thanks
Nosx
Also to make it easier their is simple function which can allow you to get list of users from a membergroup :
http://support.simplemachines.org/function_db/index.php?action=view_function;id=49
You can try this -- http://custom.simplemachines.org/mods/index.php?mod=2178