Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <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>
- /**
- * 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();
- }
- }
Add Comment
Please, Sign In to add comment