Guest User

Untitled

a guest
Oct 19th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. <crontab>
  2. <jobs>
  3. <webtex_giftcards_send_email_by_delivery_date>
  4. <schedule>
  5. <cron_expr>0 1 * * *</cron_expr>
  6. </schedule>
  7. <run>
  8. <model>giftcards/observer::sendEmailByDeliveryDate</model>
  9. </run>
  10. </webtex_giftcards_send_email_by_delivery_date>
  11. </jobs>
  12. </crontab>
  13.  
  14. /**
  15. * Send email based on delivery date specified by customer
  16. * starts every day at 01.00 am (see config.xml)
  17. */
  18. public function sendEmailByDeliveryDate()
  19. {
  20. $currentDate = date('Y-m-d');
  21. $oGiftCards = Mage::getModel('giftcards/giftcards')->getCollection()
  22. ->addFieldToFilter('mail_delivery_date', array('eq' => $currentDate))
  23. ->addFieldToFilter('card_status', 1);
  24. foreach ($oGiftCards as $oGiftCard) {
  25. $oGiftCard->send();
  26. }
  27. }
Add Comment
Please, Sign In to add comment