cast db stmt object to array
parent
38a8e9a169
commit
06b4f164f5
|
@ -50,14 +50,14 @@ function notifyall_post()
|
||||||
|
|
||||||
$recipients = DBA::p("SELECT DISTINCT `email` FROM `user`" . DBA::buildCondition($condition), $condition);
|
$recipients = DBA::p("SELECT DISTINCT `email` FROM `user`" . DBA::buildCondition($condition), $condition);
|
||||||
|
|
||||||
if (! $recipients || !is_iterable($recipients)) {
|
if (! $recipients) {
|
||||||
DI::sysmsg()->addNotice(DI::l10n()->t('No recipients found.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('No recipients found.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$notifyEmail = new NotifyAllEmail(DI::l10n(), DI::config(), DI::baseUrl(), $text);
|
$notifyEmail = new NotifyAllEmail(DI::l10n(), DI::config(), DI::baseUrl(), $text);
|
||||||
|
|
||||||
foreach ($recipients as $recipient) {
|
foreach (DBA::toArray($recipients) as $recipient) {
|
||||||
DI::emailer()->send($notifyEmail->withRecipient($recipient['email']));
|
DI::emailer()->send($notifyEmail->withRecipient($recipient['email']));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue