Skip to content

Instantly share code, notes, and snippets.

View evgv's full-sized avatar
🏠
Working from home

Eugene Zubkov evgv

🏠
Working from home
View GitHub Profile
@evgv
evgv / mage.send_email.md
Last active June 27, 2016 10:17 — forked from damiann/send_email
Magento. Send Magento template email with attachment.
// using model magento\app\code\core\Mage\Core\Model\Email\Template.php

public function send_error_email($error = NULL) {
  $mailTemplate = Mage::getModel('core/email_template');
  $mailTemplate->setSenderName('Insert Sender Name'); // use general Mage::getStoreConfig('trans_email/ident_general/name');
  $mailTemplate->setSenderEmail('[email protected]'); // use general Mage::getStoreConfig('trans_email/ident_general/email')
  $mailTemplate->setTemplateSubject('Insert Subject Title');
 $mailTemplate->setTemplateText('Insert Body Text');