File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -289,10 +289,11 @@ public function getAttachment($id)
289289
290290 /**
291291 * @param int $urlId
292+ * @param int $senderId
292293 *
293294 * @return int
294295 */
295- public function sendPendingMessages ($ urlId = 0 )
296+ public function sendPendingMessages ($ urlId = 0 , $ senderId = 0 )
296297 {
297298 if (!$ this ->allowed ()) {
298299 return 0 ;
@@ -321,13 +322,11 @@ public function sendPendingMessages($urlId = 0)
321322 continue ;
322323 }
323324
324- $ attachments = $ this ->getAttachmentToString ($ result ['id ' ]);
325-
326- self ::update (['id ' => $ result ['id ' ], 'sent ' => 1 ]);
327-
328- $ subject = $ result ['subject ' ];
329-
330325 if ($ users ) {
326+ self ::update (['id ' => $ result ['id ' ], 'sent ' => 1 ]);
327+ $ attachments = $ this ->getAttachmentToString ($ result ['id ' ]);
328+ $ subject = $ result ['subject ' ];
329+
331330 foreach ($ users as $ user ) {
332331 // Take original message
333332 $ message = $ result ['message ' ];
@@ -393,10 +392,11 @@ public function sendPendingMessages($urlId = 0)
393392 $ message = str_replace (array_keys ($ tags ), $ tags , $ message );
394393 $ message .= $ attachments ;
395394
396- MessageManager::send_message (
395+ MessageManager::send_message_simple (
397396 $ userInfo ['user_id ' ],
398397 $ subject ,
399- $ message
398+ $ message ,
399+ $ senderId
400400 );
401401 }
402402 }
You can’t perform that action at this time.
0 commit comments