Created
July 24, 2015 09:18
-
-
Save marvinosswald/927afcd1e43179177e03 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$body = "Unable to upload Order: " . $orderId; | |
$mail = new Zend_Mail(); | |
$mail->setBodyText($body); | |
$mail->setFrom($fromEmail, $fromName); | |
$mail->addTo($toEmail, $toName); | |
$mail->setSubject($subject); | |
if (Mage::getStoreConfig('h2oordertoftp/failsafe/report_file' ,Mage::app()->getStore())){ | |
$file = file_get_contents($filepath); | |
$mail->createAttachment($file,'text/xml',Zend_Mime::DISPOSITION_ATTACHMENT,Zend_Mime::ENCODING_BASE64,$orderId . '.xml'); | |
} | |
try { | |
$mail->send(); | |
return true; | |
} | |
catch (Exception $e) { | |
Mage::logException($e); | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment