0

I have create observer which sends the email. The email is working file but the problem is with the logo. I have added the logo for the all email. All the emails including the sales order shows me the new logo which i updated. Only this one doesn't.

Here is my observer code

    $enableEmail = $this->config->getGeneralConfig('email');
    $ccEmail = explode(",",$this->config->getGeneralConfig('cc_email'));

    $templateOptions = array(
        'area' => \Magento\Framework\App\Area::AREA_FRONTEND,
        'store' => \Magento\Store\Model\Store::DEFAULT_STORE_ID,
    ); 

     $fileName = "Order #".$orderId.".pdf";
            $transport = $this->transportBuilder
                ->setTemplateIdentifier($template)
                ->setTemplateOptions
                (
                    $templateOptions
                )
                ->setTemplateVars($content)
                ->setFrom($sender)
                ->addTo($email)
                ->addAttachment($generated_file->render(), $fileName)
                ->addCc($ccEmail)
                ->getTransport();
            $transport->sendMessage();

Here is the template header which is responsible to show logo.

      {{template config_path="design/email/header_template"}}

The above code is there in sales order. But sales order show the correct logo.

  • 1
    ->addAttachment is no vanilla magento functionality, maybe the extension you're using is wrong – Philipp Sander Jun 6 at 9:25
  • have you define ’email_templates.xml ? – Amit Bera Jun 6 at 9:25
  • @AmitBera Yes.. – Avesh Naik Jun 6 at 9:50
  • @PhilippSander i have commented the statement and checked. Still same problem. – Avesh Naik Jun 6 at 9:55
0

Go to content -> Design -> Configuration There is no of record on the basis of theme that are using. go to edit action for all records. Then slelect the transactional email tabs. there u found logo images. Update this images that u want to display in email headers

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.