我正尝试通过Mailgun的inline 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')
));
上述代码似乎只处理数组中的最后一个元素。