search
top

Email with attachment in Magento

I had a specific requirement to generate a CSV file and send the same as an attachment in a mail, without saving it at any physical location. I am listing here the way to do it. <?php $csv = ''; $_columns = array( 'N', 'SKU', 'Name' ); $data = array(); // prepare CSV header… foreach ($_columns as $column) { $data[] = '"'.$column.'"'; } $csv .= implode(',', $data)."\n"; $productData...
read more

Add attachment to order email in Magento

Many times there arise the need to attach files to the order mail. I am giving here a brief explanation for this: I have used Magento ver. 1.7.0.0 ( In previous version there was no mailer class). 1) Rewrite Sales Class Copy the file found at app\code\core\Mage\Sales\Model\Order.php to app\code\local\Mage\Sales\Model\Order.php Overwrite the `sendNewOrderEmail()’ method found. Here you need to...
read more

Custom Email Templates in Magento

Hello, I am explaining here the method for sending custom emails using the custom email templates with variables. 1) Create an email template from Admin-end > System > Transactional Emails, for example lets put this as Template Content <!--@vars { "htmlescape var=$customer.name":"Customer Name", "var customer.email":"Customer Email" } @--> Dear...
read more

top