簡體   English   中英

在Magento的電子郵件模板中使用數組

[英]Using Arrays in email template in Magento

我在Magento的sendNewOrderEmail函數中的模板參數中傳遞數組:

$mailer->setTemplateParams(array(
                'order'        => $this,
                'billing'      => $this->getBillingAddress(),
                'payment_html' => $paymentBlockHtml,
                'sa'           => $someArray  // This is an array
            )
        );

但是我無法在magento電子郵件模板中使用變量sa 我嘗試像{{var sa}}一樣使用它,但是在電子郵件中卻得到了Array而不是內容。 如何在電子郵件中顯示數組的內容。

您可以嘗試sa.key ,其中key是數組中的key。

或者您可以將此數組與基本params數組合並

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM