I am sending the repeatable content to the mandrill template which tied up with mailchimp through API using "weblee/mandrill" in laravel(php).
Content format sending to the API
$this->data['products'][]['title'] = "title1";
$this->data['products'][]['title'] = "title2";
$this->data['products'][]['title'] = "title3";
$this->data['products'][]['title'] = "title4";
$this->data['products'][]['title'] = "title5";
$this->data['name'] = 'John';
sendMandrilTemplate(template-name,'Subject','[email protected]',$this->data);
public static function sendMandrilTemplate($template_name,$subject,$to,$data){
$mandril = new Mail(env('MANDRILL_SECRET'));
$message = array(
'subject' => $subject,
'from_email' => config('mail.from')['address'],
'to' => array(array('email' => $to)),
'merge_vars' => array(array(
'rcpt' => $to,
)));
$i = 0;
foreach($data as $key => $value){
$template_content[$i]['name']= $key;
$template_content[$i]['content'] = $value;
$i++;
}
$result = $mandril->messages()->sendTemplate($template_name,$template_content,$message);
return $result;
}
In mandrill template I am calling this data as following
Hi <span mc:edit="name"></span>,
Products title list is as follows:
<table>
<tr><th> Product List </th></tr>
<tr mc:repeatable="products">
<td><span mc:edit="title"></span></td>
</tr>
</table>
In email, I am not receiving the email content for repeatable products title, remaining is working fine including recipient name. Please guide, what I am missing in it.