Am I going about this the correct way? Thanks for your help
This is the URL of the form: http://www.wellesleyeducationfoundation.org/index.php?option=com_chronoforms5
<?php
// write data to csv file
$filename = 'exhibitregister.csv';
$filepath='/home5/supportw/public_html/wef2013/tmp/';
// creating the CSV row
$csv_row = "test output";
/*$csv_row = $form->data['organzationname'] . "," . $form->data['contactname']; - USE DUMMY DATA ABOVE */
// saving it in the file
$file = fopen ($filepath . $filename, 'w');
fwrite ($file, $csv_row);
fclose ($file);
// adding the file to the email as attachment
/* set up files_array for the Email action. */
$files_array = array (
0 => $filepath . $filename;
);
$form->data['file_array'] = $files_array;
// csvfile is referenced in Attachment field of Email
$form->files["csvfile"]["path"] = $filepath . $filename;
?>
Debugger output is
Email] => Array
(
[0] => An email with the details below was sent successfully:
[1] => To:myemail@gmail.com
[2] => Subject:Wellesley STEM Expo Exhibitor Confirmation
[3] => From name:Wellesley STEM Expo
[4] => From email:wellesleystemexpo@gmail.com
[5] => CC:
[6] => BCC:
[7] => Reply name:
[8] => Reply email:
[9] => Attachments:
---