php - Mailgun Batch With Attachment -


is possible use mailgun batch sending mail api , add attachment per recipient?

$mgclient = new mailgun('my-app-key'); $domain = config('my-domain');  $recipent_addresses = array('bob@example.com','rudy@example.com'); $chunk = array(   'bob@example.com' => array(      'name' => 'bob example',      'file' => '/path/to/bobpdf.pdf'   ),   'rudy@example.com' => array(      'name' => 'rudy example',      'file' => '/path/to/rudypdf.pdf'   ), );  $data = array(   'from' => 'me <me@example.com>',   'to' => $recipent_addresses,   'subject' => 'subject',   'html' => view('emails.mg_pdf_submitted'),   'recipient-variables' => json_encode($chunk),         'o:tag' => array('mytag'), ); 

i have tried this:

$result = $mgclient->sendmessage($domain, $data, array(    'attachment' => '%recipient.file%' )); 

but no luck. please , in advance.


Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -