문제

I am experiencing an issue where the sender email address for the order confirmation email is not what is set in the admin panel for Magento 2.3. I have checked both SMTP settings and the store email addresses and none of them match what is being used to send emails. Where would I look in the file structure to find the appropriate file that may contain this email address?

도움이 되었습니까?

해결책

The actual files that you need to check to debug your issue are SenderBuilder and Sender as given below

its under this path

vendor/magento/module-sales/Model/Order/Email

Magento\Sales\Model\Order\Email\SenderBuilder

investigate the method

/**
     * Configure email template
     *
     * @return void
     */
    protected function configureEmailTemplate()
    {
        $this->transportBuilder->setTemplateIdentifier($this->templateContainer->getTemplateId());
        $this->transportBuilder->setTemplateOptions($this->templateContainer->getTemplateOptions());
        $this->transportBuilder->setTemplateVars($this->templateContainer->getTemplateVars());
        $this->transportBuilder->setFromByScope(
            $this->identityContainer->getEmailIdentity(),
            $this->identityContainer->getStore()->getId()
        );
    }

Magento\Sales\Model\Order\Email\Sender

 /**
     * Create Sender object using appropriate template and identity.
     *
     * @return Sender
     */
    protected function getSender()
    {
        return $this->senderBuilderFactory->create(
            [
                'templateContainer' => $this->templateContainer,
                'identityContainer' => $this->identityContainer,
            ]
        );
    }

In addition to these files, you can also debug this one , where the From Header is set for all the emails.

Magento\Framework\Mail\Template\TransportBuilder

As always, double check your configuration settings (Stores - Configuration - sales - sales email - Order - New Order Confirmation Email Sender) in all the scopes and clean the config cache, before you dive into debugging.

Hope this helps !

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top