Send a file header in controller (file download)

To return a downloadable file in a controller action, you have to send a file header in controller like that: $fileName = ‘mm_actioncodes_export_’.date(“Ymd_His”).’.csv’; $fp = fopen(Mage::getBaseDir(‘var’) . DS .’export’ . DS . $fileName, ‘w’); fputcsv($fp, $codes, ‘;’, ‘”‘); fclose($fp); $this->_prepareDownloadResponse($fileName, array( ‘type’ => ‘filename’, ‘value’ => Mage::getBaseDir(‘var’) . DS .’export’ . DS . $fileName, //’rm’ => true […]

Get Mailcatcher working on Linux

To get Mailcatcher (http://mailcatcher.me/) running under PuPHPet-based Vagrant (http://puphpet.com) I had to implement the following shell script in puphpet/files/startup-always/correct_mail_catcher.sh: #!/bin/sh sed -i “s/^sendmail_path=\/usr\/local\/rvm\/wrappers\/default\/catchmail -f$/sendmail_path=\/usr\/local\/rvm\/wrappers\/default\/catchmail -f mailman@local.sheldon.dev/g” /etc/php.d/zzzz_custom.ini echo “SET sendmail_path” The script adds a value to the -f param and that fixes the issue, that no mails are collected by mailcatcher. Versions: Vagrant: 1.6.2 Puppet: 3.4.3 OS: CentOS 6.5 (Final) / […]