【发布时间】:2016-12-10 00:10:12
【问题描述】:
我正在尝试通过 Mailgun 的内联 API 参数传递多个图像。我只使用一张图片没有问题,但是当我尝试使用多张图片时 - 如下面的代码所示 - 只有数组中的最后一张图片会显示在电子邮件中。
$template = View::make('emails.template')->render();
$result = $mgClient->sendMessage($domain, array(
'from' => $sender,
'to' => implode(',',$emailAddresses),
'subject' => '%recipient.subject%',
'text' => $messageText,
'recipient-variables' => json_encode($credentials),
'html' => $template
), array(
'inline' => array(
'path/to/image1.png',
'path/to/image2.png',
'path/to/image3.png',
'path/to/image4.png')
));
上面的代码就像数组中的最后一个元素是唯一的元素一样工作。
使用 Mailgun 发送内联图像的文档位于 here,据说 here “您可以发布多个内联值”,这意味着我肯定做错了。
【问题讨论】:
-
你用的是官方的mailgun SDK,对吧?
-
@user866762,是的,我是
标签: php laravel inline mailgun