File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ private function getLogHandlers()
7272
7373 protected function getMailerHandler ()
7474 {
75- $ recipients = $ this ->getNotificationRecipients ();
75+ $ recipients = $ this ->getFilteredNotificationRecipients ();
7676 if (empty ($ recipients )) {
7777 return false ;
7878 }
@@ -88,6 +88,20 @@ protected function getMailerHandler()
8888 return $ mailerHandler ;
8989 }
9090
91+ private function getFilteredNotificationRecipients ()
92+ {
93+ $ result = [];
94+
95+ $ recipients = $ this ->getNotificationRecipients ();
96+ foreach ($ recipients as $ recipient ) {
97+ if (!empty ($ recipient ['address ' ]) && filter_var ($ recipient ['address ' ], FILTER_VALIDATE_EMAIL )) {
98+ $ result [] = $ recipient ;
99+ }
100+ }
101+
102+ return $ result ;
103+ }
104+
91105 protected function logDebug ($ message , array $ context = [])
92106 {
93107 return $ this ->icLogger ->debug ($ message , $ context );
You can’t perform that action at this time.
0 commit comments