Skip to content

Instantly share code, notes, and snippets.

@marvinosswald
Created July 24, 2015 09:18
Show Gist options
  • Save marvinosswald/927afcd1e43179177e03 to your computer and use it in GitHub Desktop.
Save marvinosswald/927afcd1e43179177e03 to your computer and use it in GitHub Desktop.
$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