Skip to content
Snippets Groups Projects
Commit 0ea592b2 authored by Spencer McCoy's avatar Spencer McCoy
Browse files

Merge branch 'email_change' into 'master'

Change daily digest conditions for creative email

After making this AWESOME email script to let people know when lockups
were awaiting approval, Marcelo said he'd rather only get emails AFTER the
communicator had approved the lockup.

Putting this in to you for cross training and experience purposes. After we merge the change we'll practice deploying it.

See merge request !5
parents 475a1b1c 2b9520a1
No related branches found
No related tags found
1 merge request!5Change daily digest conditions for creative email
...@@ -38,19 +38,16 @@ UNL Lockup Factory ...@@ -38,19 +38,16 @@ UNL Lockup Factory
'; ';
Emailer::sendMail($approver->email, "UNL Lockup Factory Digest", $body); Emailer::sendMail($approver->email, "UNL Lockup Factory Digest", $body);
echo 'sent mail to ' . $approver->email;
echo $body;
} }
} }
# also do this for creative # also do this for creative
$creative_emails = array('mplioplis2@unl.edu'); # configurable value $creative_emails = array('mplioplis2@unl.edu'); # configurable value
# find all lockups that they have that are awaiting communicator approval # find all lockups that they have that are awaiting creative approval
# (that were generated in the last 24 hours)
$lockups = Lockup::find('all', array('conditions' => $lockups = Lockup::find('all', array('conditions' =>
array('creative_status = ? AND date_created >= ?', 'awaiting_approval', array('creative_status = ? AND status = ?',
date('Y-m-d H:i:s', time() - 24*60*60)))); 'awaiting_approval', 'approved')));
# send an email if there is at least 1 of these # send an email if there is at least 1 of these
if (count($lockups) > 0) { if (count($lockups) > 0) {
...@@ -70,6 +67,4 @@ UNL Lockup Factory ...@@ -70,6 +67,4 @@ UNL Lockup Factory
'; ';
Emailer::sendMail($creative_emails, "UNL Lockup Factory Digest", $body); Emailer::sendMail($creative_emails, "UNL Lockup Factory Digest", $body);
echo 'sent mail to creative';
echo $body;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment