Example #1
0
 public static function sendFileReplaceNew()
 {
     $funcArgs = func_get_args();
     // Get notification type from caller
     $notificationType = $funcArgs[0];
     // Get the file table object from passed in parameter
     $fileTable = $funcArgs[1];
     // Get the previous filename
     $previousFilename = $funcArgs[2];
     if ($fileTable instanceof JTable) {
         // Get commentor
         $owner = JXFactory::getUser($fileTable->user_id);
         // Get Wall Post followers users
         $followers = $fileTable->followers;
         $userList = explode(',', $followers);
         $userList = self::groupUserByLanguage($userList, $fileTable->user_id, $notificationType);
         $messageUrl = StreamMessage::getMessageUri($fileTable->stream_id);
         $arrParam = array('fileTable' => $fileTable, 'previousFilename' => $previousFilename, 'owner' => $owner);
         $jConfig = new JConfig();
         foreach ($userList as $language => $bccEmail) {
             self::loadLanguage($language);
             $bodyContent = self::getHeaderContent(JText::_('COM_STREAM_NOTIFICATION_FILE_REPLACE_NEW'), $messageUrl);
             $bodyContent .= self::getBodyContent('notification.file.replace', $arrParam);
             $bodyContent .= self::getFooterContent();
             $subject = JText::sprintf('COM_STREAM_NOTIFICATION_FILE_REPLACE_NEW_SUBJECT', $owner->name);
             self::sendMail($jConfig->mailfrom, $jConfig->fromname, $jConfig->mailfrom, $subject, $bodyContent, $bccEmail);
         }
     }
 }