0
我很努力地訪問自定義變量我使用WHMCS API發送電子郵件時的設置... 請參閱下面的API命令以及smarty標籤我正在使用嘗試和顯示數組。如何在WHMCS電子郵件中訪問Smarty模板中的自定義變量
我嘗試了好幾種不同的方法,但不能訪問我所定義的數組...
任何援助將不勝感激:)。
API命令
$results = localAPI("SendEmail", ['messagename'=>'My Email Template', 'id'=>$client->userid, 'customvars' => ['myvariables' => ['test_var_1'=>'value 1', 'test_var_2'=>'value 2']]]);
Smarty的模板語法我試過
{foreach from=$myvariables item=custom_field}
{$custom_field.test_var_1}
{/foreach}
我收到什麼儘管在電子郵件...我也試過
{foreach from=$client_custom_fields.myvariables item=custom_field}
{$custom_field.test_var_1}
{/foreach}