diff options
author | Evan Prodromou <evan@prodromou.name> | 2008-07-21 05:28:13 -0400 |
---|---|---|
committer | Evan Prodromou <evan@prodromou.name> | 2008-07-21 05:28:13 -0400 |
commit | 2bdc6f0643d89b291531b73ce45a1686dec996f8 (patch) | |
tree | 1e4daf40b884977be36ffb17f0709a7427260776 /lib | |
parent | 8bc9834854e4d8b038cd8fd39262f8bcf3c63757 (diff) |
logging and checking
darcs-hash:20080721092813-84dde-ac19bbdd85bbf796ecf8ffbc8c0cb05d0d1667ab.gz
Diffstat (limited to 'lib')
-rw-r--r-- | lib/mail.php | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/mail.php b/lib/mail.php index c9c59db35..2f4f502d4 100644 --- a/lib/mail.php +++ b/lib/mail.php @@ -169,11 +169,15 @@ function mail_broadcast_notice_sms($notice) { $cnt = $user->find(); - while ($user->fetch()) { - $success = mail_send_sms_notice($notice, $user); - if (!$success) { - common_log(LOG_ERR, 'Could not send SMS message to user', __FILE__); - return false; + common_log(LOG_INFO, "Sending notice " . $notice->id . " to $cnt subscribers", __FILE__); + + if ($cnt) { + while ($user->fetch()) { + $success = mail_send_sms_notice($notice, $user); + if (!$success) { + common_log(LOG_ERR, 'Could not send SMS message to user', __FILE__); + return false; + } } } @@ -186,6 +190,8 @@ function mail_send_sms_notice($notice, $user) { $to = $name . ' <' . $user->smsemail . '>'; $other = $notice->getProfile(); + common_log(LOG_INFO, "Sending notice " . $notice->id . " to " . $user->smsemail, __FILE__); + $headers = array(); $headers['From'] = $user->incomingemail; $headers['To'] = $to; |