How to Change Email Logo in magento 2
-
15-04-2021 - |
OTHER TIPS
1-On the Admin sidebar, Content > Design > Configuration > Select your current theme > .
You can see the existing design configuration on the management table, then click on Edit under Action.
2-On the workplace, please scroll down to Other Settings, open Transactional Email setion.
3-To change your Logo Email, click on Upload to choose one of the image files you want to aplly for your logo.
4-Enter the alternate text identify the Logo Image Alt. You can give the height and width of logo. Save configuration and changes will reflect.
For me, the folder permissions were off so magento could not create the folder at /pub/media/email/logo/stores/1
I just manually created that path, and adding my image.
Reference source: https://magentip.com/change-magento-2-store-logo/
You can upload and overwrite the file in logo file path, for example
/frontend/Magento/luma/pl_PL/images/logo.svg
If you want to Change magento 2 logo programmatically, go to \app\design\frontend\Magento\luma\Magento_Theme\layout\default.xml
Add this code
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="logo">
<action method="setLogoFile">
<argument name="logo_file" xsi:type="string">
images/yournewlogo.png
</argument>
</action>
</referenceBlock>
<referenceBlock name="logo" remove="true" />
</body>
</page>
Replace images/yournewlogo.png
with your file path
As @Moin Malek answered the first way to go for people with less programming experience is uploading the specific email logo over the GUI backend.
For people with more programming and especially frontend developing experience, the way to go is like the following:
In app/design/frontend/<Vendor>/<theme>/Magento_Email/web
please add a file called logo_email.png
.
Explanation:
In vendor/magento/module_email/Model/AbstractTemplate.php
there is a constant defined like const DEFAULT_LOGO_FILE_ID = 'Magento_Email::logo_email.png';
which represents the correct named logo file.