2015-12-11, 10:36 AM
Hi,
I have some strange problem with script that send notifications to my users.
Here you have my function:
If I execute this function once, it works fine (Send one pm).
But when I try to execute it more than once (different messages, different $toid) script send only one pm (first one).
Is this limitation of mybb?
How can I send more than one different message?
Greetings from Poland,
Mariusz W. czerwony03
I have some strange problem with script that send notifications to my users.
Here you have my function:
function send_pw($subject,$message,$toid,$fromid=564)
{
global $content;
$subject="[PANEL] ".$subject;
$message.="
[b]Wiadomosc wygenerowana automatycznie. Prosimy na nia nie odpowiadac.[/b]";
$pmhandler = new PMDataHandler();
$pm = array(
"subject" => $subject,
"message" => $message,
"fromid" => $fromid,
"toid" => array($toid)
);
$pm['options'] = array(
"signature" => 0,
"disablesmilies" => 0,
"savecopy" => 0,
"readreceipt" => 0
);
$pmhandler->set_data($pm);
if(!$pmhandler->validate_pm())
{
debug($pm_errors = $pmhandler->get_friendly_errors());
}
else $pminfo = $pmhandler->insert_pm();
return 1;
}
If I execute this function once, it works fine (Send one pm).
But when I try to execute it more than once (different messages, different $toid) script send only one pm (first one).
Is this limitation of mybb?
How can I send more than one different message?
Greetings from Poland,
Mariusz W. czerwony03