I have a crontab for giftcards that get sent when a delivery date is selected. It doesn't appear to be running.
This is in my config.xml:
<crontab>
<jobs>
<webtex_giftcards_send_email_by_delivery_date>
<schedule>
<cron_expr>0 1 * * *</cron_expr>
</schedule>
<run>
<model>giftcards/observer::sendEmailByDeliveryDate</model>
</run>
</webtex_giftcards_send_email_by_delivery_date>
</jobs>
</crontab>
This is the code in Observer that it's supposed to call:
/**
* Send email based on delivery date specified by customer
* starts every day at 01.00 am (see config.xml)
*/
public function sendEmailByDeliveryDate()
{
$currentDate = date('Y-m-d');
$oGiftCards = Mage::getModel('giftcards/giftcards')->getCollection()
->addFieldToFilter('mail_delivery_date', array('eq' => $currentDate))
->addFieldToFilter('card_status', 1);
foreach ($oGiftCards as $oGiftCard) {
$oGiftCard->send();
}
}