Skip to content

Instantly share code, notes, and snippets.

View yogesh-15git's full-sized avatar

Yogesh Agarwal yogesh-15git

  • Jaipur, Rajasthan, India
View GitHub Profile
@damiann
damiann / send_email
Last active October 12, 2020 16:48
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('insert@sender.email'); // use general Mage::getStoreConfig('trans_email/ident_general/email')
$mailTemplate->setTemplateSubject('Insert Subject Title');
$mailTemplate->setTemplateText('Insert Body Text');