Is there a way I can run some code from a plugin when a future dated entry goes 'live' from 'pending'? I am trying to send an email update that a new entry has been posted. The related post below helped me with this, but it doesn't seem to cover future dated entries.
Here's what I have so far...
craft()->on('entries.onBeforeSaveEntry', function(Event $event) {
$entry = $event->params['entry'];
if ($entry->section->handle !== 'blog') {
return;
}
if ($entry->status !== 'live') {
return;
}
if (!$entry->getContent()->emailSent) {
// send email
}
$entry->setContentFromPost(array('emailSent' => true));
});
Related to: Checking for first time an entry is "published" i.e. saved with a Live status
Thanks!