1

my custom transactional email is not loading image for header and footer. i am sending the mail through observer other email are working perfectly only the observer email not loading header and footer properly.

$emailTemplate  = Mage::getModel('core/email_template')
                                ->loadDefault('review_template');                                    
                $emailTemplate->setSenderName(Mage::getStoreConfig('trans_email/ident_general/name'));
                $emailTemplate->setSenderEmail(Mage::getStoreConfig('trans_email/ident_general/email')); 
                $emailTemplate->setTemplateSubject('Make a Review');  
                $email=$order->getCustomerEmail();
                $emailTemplateVariables = array();
                $emailTemplateVariables['test'] = $companyinfo->getCompanyName();
                $emailTemplateVariables['name'] = $order->getCustomerFirstname().' '.$order->getCustomerLastname();
                $emailTemplateVariables['reviewurl'] = Mage::getUrl('test/index/review',array('ref' => $ref));

                $processedTemplate = $emailTemplate->getProcessedTemplate($emailTemplateVariables);
                $emailTemplate->send($email,$order->getCustomerFirstname().' '.$order->getCustomerLastname(), $emailTemplateVariables);
5
  • Check Preview of template review_template in admin Transactional Emails section Nov 23 '15 at 7:37
  • preview is showing perfect but when i send it is not loading header and footer images.. Nov 23 '15 at 7:43
  • check image loading for your mail is allowed in your mail client. if this is the case with loading images..... Nov 23 '15 at 7:51
  • working for other email but not loading the email that are send from observer. Nov 23 '15 at 7:53
  • set area that might be creating isssue Nov 23 '15 at 8:00
1

setting the setDesignConfig and area to frontend solved my problem.

$emailTemplate  = Mage::getModel('core/email_template')
                                ->loadDefault('review_template');  
$emailTemplate
                ->setDesignConfig(array('area' => 'frontend', 'store' => $store->getId()));  
            $emailTemplate->send($email,$order->getCustomerFirstname().' '.$order->getCustomerLastname(), $emailTemplateVariables,$storeId=null);

This site is temporarily in read only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .