Hello,
I just finished my work implementing plupload as custom field for multi uploads within chronoforms. Since I had to do a 'hack' in /administrator/com_chronoforms/form_actions/mail/mail.php to parse a field array for including the paths to the uploaded attachments I wanted to ask if its possible to implement a snippet like ...
if (isset($form->data["attachments"])) {
foreach($form->data["attachments"] as $attachment){
$email_attachments[] = $_SERVER["DOCUMENT_ROOT"].DIRECTORY_SEPARATOR.$attachment;
}
}
.. just before JUtility::sendMail() by default or point me to a more elegant solution.
Thanks in adavance,
mplock
I just finished my work implementing plupload as custom field for multi uploads within chronoforms. Since I had to do a 'hack' in /administrator/com_chronoforms/form_actions/mail/mail.php to parse a field array for including the paths to the uploaded attachments I wanted to ask if its possible to implement a snippet like ...
if (isset($form->data["attachments"])) {
foreach($form->data["attachments"] as $attachment){
$email_attachments[] = $_SERVER["DOCUMENT_ROOT"].DIRECTORY_SEPARATOR.$attachment;
}
}
.. just before JUtility::sendMail() by default or point me to a more elegant solution.
Thanks in adavance,
mplock
Hi mplock,
I will add this to the to do list, you may also do it using some dynamic PHP code, alter the email action "attachments" setting and inject a list of dummy fields names and add your files paths under those names in the $form->files array.
The code above should go inside a Custom code action BEFORE your Email action.
Regards,
Max
I will add this to the to do list, you may also do it using some dynamic PHP code, alter the email action "attachments" setting and inject a list of dummy fields names and add your files paths under those names in the $form->files array.
<?php
//assuming your email action id is 55
$dummies = array('f1','f2','f3','f4');
$form->set('email_55', 'attachments', implode(',', $dummies));
foreach($dummies as $dummy){
$form->files[$dummy] = array('path' => FILE_PATH);
}
?>
The code above should go inside a Custom code action BEFORE your Email action.
Regards,
Max
This topic is locked and no more replies can be posted.
