EDIT:
I developed a custom action myself that also shows the filenames in the email text-content.
Thanks anyway.
Original post:
Hi Greyhead😉
I spent hours and hours with the following problem:
I the current Version of CF, your "custom Email [GH]"
and your snippet I found here: http://www.chronoengine.com/faqs/view/2 ... email.html
Problem:
When I add {file_array} in the attachments field, nothing is sent.
But when debugging the 'file_array' looks perfect, but no attachment is sent.
When entering the server path and filenames manually, everything is sent properly.
The custom code (mode: controller) I use:
<?php
if ( !isset($form->data['infomaterial']) || count($form->data['infomaterial']) == 0 ) {
return;
}
$files_array = array (
1 => JPATH_SITE.'/download/a.pdf',
2 => JPATH_SITE.'/download/b.pdf',
3 => JPATH_SITE.'/download/c.pdf',
);
$attach_files = array();
foreach ( $files_array as $k => $v ) {
if ( in_array($k, $form->data['infomaterial']) ) {
$attach_files[] = $v;
}
}
$form->data['file_array'] = $attach_files;
?>
And I assure I entered {file_array} in the attachments field in your email [GH] 'action'.
Please help.