getRequest()->getParams(); $product = Mage::getModel('catalog/product')->load($data['product']); if(Mage::helper('giftcards')->isUseDefaultPicture() || !$product->getId()) { $picture = Mage::getDesign()->getSkinUrl('images/giftcard.png',array('_area'=>'frontend')); } else { if ($product->getId() && $product->getImage() != 'no_selection') { $picture = Mage::helper('catalog/image')->init($product, 'image'); } else { $picture = Mage::getDesign()->getSkinUrl('images/giftcard.png',array('_area'=>'frontend')); } } $currencySymbol = Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol(); if($currencySymbol == '€') { $currencySymbol = '€'; } elseif($currencySymbol == '£') { $currencySymbol = '£'; } $storeId = Mage::app()->getStore()->getId(); $post = array( 'amount' => $currencySymbol.$data['price'], 'code' => 'XXXX-XXXX-XXXX', 'email-to' => $data['mail-to'], 'email-from' => $data['mail-from'], 'link' => '#', 'email-message' => $data['mail-message'], 'store-phone' => Mage::getStoreConfig('general/store_information/phone'), 'picture' => $picture, ); $mailTemplate = Mage::getModel('core/email_template'); $postObject = new Varien_Object(); $postObject->setData($post); $postObject->setStoreId($storeId); if($data['card-type'] == 'email') { $template = 'giftcards/email/email_template'; } elseif ($data['card-type'] == 'print') { $template = 'giftcards/email/print_template'; } $mailTemplate->setDesignConfig(array('area' => 'frontend', 'store' => $storeId)) ->sendTransactional( Mage::getStoreConfig($template), 'general', '', null, array('data' => $postObject) ); //$emailTemplate = Mage::getModel('core/email_template')->loadDefault('giftcards_email_email_template'); $mail = ''; $mail .= ''; $mail .= $mailTemplate->getProcessedTemplate(); $mail .= ''; echo $mail;exit; } }