#146 Get Mailgun to properly send the attachments

merge-requests/2/head
Mike Koch 9 years ago
parent 190b3ff475
commit dc4eb3997c

@ -399,9 +399,9 @@ function hesk_mail($to,$subject,$message,$htmlMessage,$cc=array(),$bcc=array())
{ {
$postfields['html'] = $htmlMessage; $postfields['html'] = $htmlMessage;
} }
if ($hesk_settings['attachments']['use'] && isset($ticket['attachments']) && strlen($ticket['attachments']) && $ticket['attachments'] != '' ) if ($modsForHesk_settings['attachments'] && $hesk_settings['attachments']['use'] && isset($ticket['attachments']) && strlen($ticket['attachments']))
{ {
processDirectAttachments('mailgun', $postfields); $postfields = processDirectAttachments('mailgun', $postfields);
} }
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields); curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
@ -856,6 +856,7 @@ function processDirectAttachments($emailMethod, $postfields = NULL, $boundary =
$postfields['attachment['.$i.']'] = '@'.HESK_PATH.$hesk_settings['attach_dir'].'/'.$saved_name; $postfields['attachment['.$i.']'] = '@'.HESK_PATH.$hesk_settings['attach_dir'].'/'.$saved_name;
$i++; $i++;
} }
return $postfields;
} else { } else {
$attachments = ''; $attachments = '';
foreach ($att as $myatt) { foreach ($att as $myatt) {

Loading…
Cancel
Save