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);
  • Check Preview of template review_template in admin Transactional Emails section – Minesh Patel Nov 23 '15 at 7:37
  • preview is showing perfect but when i send it is not loading header and footer images.. – Qaisar Satti 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..... – Minesh Patel Nov 23 '15 at 7:51
  • working for other email but not loading the email that are send from observer. – Qaisar Satti Nov 23 '15 at 7:53
  • set area that might be creating isssue – Minesh Patel 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);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.