简体   繁体   English

将magento交易电子邮件logo_url更改为外部链接

[英]Change magento transactional emails logo_url to external link

I need to change 我需要改变

logo_url logo_url

for transactional emails with external link, for example 例如,用于带有外部链接的交易电子邮件

https://exampledomainname.com/image.png https://exampledomainname.com/image.png

but I can't hardcode all or even one file in 但我无法硬编码其中的全部甚至一个文件

app/locale 应用程式/地区

Is there any way to add external url as logo_url? 有什么办法可以将外部网址添加为logo_url? As when I go here: 当我去这里时:

System > Configuration > General > Design > Transactional Emails 系统>配置>常规>设计>交易电子邮件

I can only add image to hosting area 我只能将图像添加到托管区域

As far as I was looking into the web there is no best practice way to directly rewrite logo_url , but we can create custom variable and then use it into email templates. 就我浏览网络而言,没有直接重写logo_url best practice方法,但是我们可以创建自定义变量,然后将其用于电子邮件模板。 We can do it manually from admin or using programming way. 我们可以通过管理员手动或使用编程方式进行操作。 My requirements is to implement this in programming way, so we start with shell script( shell\\external_logo_url.php ) to create custom variable: 我的要求是以编程方式实现此目标,因此我们从shell脚本( shell\\external_logo_url.php )开始创建自定义变量:

<?php    

require_once '../abstract.php';

class External_Logo_Url extends Mage_Shell_Abstract
{
    public function run()
    {
        $variable = Mage::getModel('core/variable')
            ->setCode('variable-code')
            ->setName('variable-name')
            ->setPlainValue('variable-value')
            ->save();
    }
}

$shell = new External_Logo_Url();
$shell->run();

Also we need to change template files in app\\locale , so you need replace all template files or custom templates that you need. 另外,我们需要在app\\locale更改模板文件,因此您需要替换所有需要的模板文件或自定义模板。 You should look for {{var logo_url}} and replace with {{customVar code=variable-code}} . 您应该寻找{{var logo_url}}并替换为{{customVar code=variable-code}}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM