I need to attach a file to a transactional email. Basically I have a cron job that generates a report and needs to it email to an admin user.
I was hoping something like this exists:
Mage::getModel('core/email_template')
->setDesignConfig(array('area'=>'frontend', 'store'=>1))
->createAttachment($file)
->sendTransactional($templateID, $sender, $email, “Admin", $vars);
Thanks in advance for any help.
I found that magento uses the zend_mail frame work. You can call the getMail function to access this framework to add an attachement.
http://framework.zend.com/manual/en/zend.mail.attachments.html
Example