News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

sendpm to group(s)

Started by nosx, August 13, 2011, 04:23:53 AM

Previous topic - Next topic

nosx

Hello,

How do I send a pm to a GROUP of members using the using the sendpm() function ?

Thanks,
Nosx

Ricky.

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

nosx

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

Ricky.

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.

nosx


Ricky.

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

Joker™

Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Advertisement: