Browse code

Return unordered list instead of plain text with breaks

Benjamin Roth authored on22/06/2017 11:23:40
Showing1 changed files
... ...
@@ -41,6 +41,7 @@ class NewsNotifications extends \System
41 41
         // Load groups and notification models if we have news to share
42 42
         if ($News->numRows && ($Notification = \NotificationCenter\Model\Notification::findByPk($Archive->nc_notification)) !== null && ($Groups = \MemberGroupModel::findMultipleByIds($arrGroupIds)) !== null)
43 43
         {
44
+
44 45
           while ($Groups->next())
45 46
           {
46 47
             // Skip disabled groups
... ...
@@ -55,18 +56,19 @@ class NewsNotifications extends \System
55 56
             // Send notification to each member
56 57
             if ($Members !== null)
57 58
             {
58
-              $strNews = '';
59
+              $arrNews = array();
60
+              $News->reset();
59 61
               while ($News->next())
60 62
               {
61
-                $strNews .= date('d.m.Y',$News->date)." - ".$News->headline."\n";
63
+                $arrNews[] = date('d.m.Y',$News->date)." - ".$News->headline;
62 64
               }
63 65
               while ($Members->next())
64 66
               {
65 67
                 $Notification->send(array
66 68
                 (
67 69
                   'member_email'      => $Members->email,
68
-                  'news_topics'       => $strNews,
69
-                  'news_topics_html'  => nl2br($strNews)
70
+                  'news_topics'       => implode("\n",$arrNews),
71
+                  'news_topics_html'  => "<ul>\n<li>".implode("</li>\n<li>",$arrNews)."</li>\n</ul>"
70 72
                 ),
71 73
                 $GLOBALS['TL_LANGUAGE']);
72 74
               }