diff --git a/scripts/daily_digest.php b/scripts/daily_digest.php index b6175e38be3343509e89389c877e5a9f37f114ce..909835d5dffe444f3cc5c7a193a343f45e0ec425 100644 --- a/scripts/daily_digest.php +++ b/scripts/daily_digest.php @@ -38,19 +38,16 @@ UNL Lockup Factory '; Emailer::sendMail($approver->email, "UNL Lockup Factory Digest", $body); - echo 'sent mail to ' . $approver->email; - echo $body; } } # also do this for creative $creative_emails = array('mplioplis2@unl.edu'); # configurable value -# find all lockups that they have that are awaiting communicator approval -# (that were generated in the last 24 hours) +# find all lockups that they have that are awaiting creative approval $lockups = Lockup::find('all', array('conditions' => - array('creative_status = ? AND date_created >= ?', 'awaiting_approval', - date('Y-m-d H:i:s', time() - 24*60*60)))); + array('creative_status = ? AND status = ?', + 'awaiting_approval', 'approved'))); # send an email if there is at least 1 of these if (count($lockups) > 0) { @@ -70,6 +67,4 @@ UNL Lockup Factory '; Emailer::sendMail($creative_emails, "UNL Lockup Factory Digest", $body); - echo 'sent mail to creative'; - echo $body; }