How to send array in Mailgun handlebars Context

天涯浪子 提交于 2021-02-11 12:41:56

问题


I am trying to send an array in Mailgun email as a list for this I did:

$result = $mgClient->messages()->send(
   $this->mailgunDomain,
   [
        .
        .
        .
        'v:list' => json_encode($finalList),
   ]);

$finalList is a 2d array which looks something like this:

[
  [
     "key" => "someKey"
     "value" => "someValue"
  ],
  ...
]

But now the main problem is I do not know how can I use this array as handlebars context Because,

I get:

{
    "list": "[{"key":"someKey","value":"someValue"}]"
}

I want:

{
    "list": [{"key":"someKey","value":"someValue"}]
}

来源:https://stackoverflow.com/questions/63585608/how-to-send-array-in-mailgun-handlebars-context

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!