Quantcast
Channel: Active questions tagged email - Stack Overflow
Viewing all articles
Browse latest Browse all 29758

Order confirmation Email Logo broken image changes

$
0
0

I have used Magento2.3.3 open-source version and everything is working as expected except the order confirmation logo. It's shown as a broken image.

I overwrote the order confirmation logic for delaying mail as per the configuration(custom request). I thought it is due to my custom code, so I disabled my custom module and still got the same issue.

Core File Path : \Magento\Sales\Model\Order\Email\Sender\OrderSender

Rewritten functions : send() and checkAndSend()

public function send(Order $order, $forceSyncMode = false)
{

    $isAllowOrderConfirmation = $this->dataHelper->isAllowSendOrderConfirmation($order);

    $order->setSendEmail($this->identityContainer->isEnabled());
    if (!$this->globalConfig->getValue('sales_email/general/async_sending') || $forceSyncMode) {
        if ($this->checkAndSend($order)) {
            /* My custom validation */
            if($isAllowOrderConfirmation) {
                $order->setEmailSent(true);
                $this->orderResource->saveAttribute($order, ['send_email', 'email_sent']);
                return true;
            }
        }
    } else {
        $order->setEmailSent(null);
        $this->orderResource->saveAttribute($order, 'email_sent');
    }
    $this->orderResource->saveAttribute($order, 'send_email');

    return false;
}

 protected function checkAndSend(Order $order)
{

  /* My custom validation */
    $isAllowOrderConfirmation = $this->dataHelper->isAllowSendOrderConfirmation($order);
    $this->identityContainer->setStore($order->getStore());
    $this->prepareTemplate($order);

    /** @var SenderBuilder $sender */
    $sender = $this->getSender();

    try {
        /* My custom validation */
        if ($isAllowOrderConfirmation) {
            $sender->send();
        }

    } catch (\Exception $e) {
        $this->logger->error($e->getMessage());
        return false;
    }
    try {
        /* My custom validation */
        if ($isAllowOrderConfirmation) {
            $sender->sendCopyTo();
        }
    } catch (\Exception $e) {
        $this->logger->error($e->getMessage());
    }
    return true;
}

Anyone help me to resolve this issue. FYI: In other transactional email logo's are rendering as expected.

Thanks,


Viewing all articles
Browse latest Browse all 29758

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>