We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14568
    • 14 Posts
    I’m using the quick n’ dirty method as described here: http://modxcms.com/forums/index.php/topic,31097.msg188688.html#msg188688 to attach form data as a CSV.

    Only problem is that its not attaching, the CSV. I’ve checked the logs, and nothing is indicated there. There is already an attach button on the form would that interfere?

    The extra line to eform.inc.php passes with out any errors, any help would be much appreciated.

      • 29774
      • 386 Posts
      therebechips Reply #2, 17 years ago
      No it wouldn’t make any difference - in my form I am also using an attachment field.

      Are you using eform 1.4.4.5? If you’re using a later version then it may help to see the code block where I inserted the hack in eform.inc.php:
      if(!$noemail) {
      					if($sendirect) $to = $fields['email'];
      					$mail = new PHPMailer();
      					$mail->IsMail();
      					$mail->CharSet = $modx->config['modx_charset'];
      					$mail->IsHTML($isHtml);
      					$mail->From		= $from;
      					$mail->FromName	= $fromname;
      					$mail->Subject	= $subject;
      					$mail->Body		= $report;
      					AddAddressToMailer($mail,"replyto",$replyto);
      					AddAddressToMailer($mail,"to",$to);
      					AddAddressToMailer($mail,"cc",$cc);
      					AddAddressToMailer($mail,"bcc",$bcc);
      					
      					// attach csv
      					if ($fields['csv'] !='') {
      						$mail->AddStringAttachment($fields['csv'], 'CSV_'.$fields['registrationid'].'.csv');
      					}
      					
      					AttachFilesToMailer($mail,$attachments);
      					if(!$mail->send()) return 'Main mail: ' . $_lang['ef_mail_error'] . $mail->ErrorInfo;
      				}
      
      


      Otherwise all I can suggest is that you try to debug the process from start to finish - ie check that your event is being triggered, that your csv file is being generated correctly, that it gets pased to a field called ’csv’ and so on.
        Snippets: GoogleMap | FileDetails | Related Plugin: SSL
        • 14568
        • 14 Posts
        Thanks therebechips, I’m on 1.4.4.6, so its line 453 for me.

        I’ll carry on debugging. I won’t copy and paste from the internets I’ll type it( repeat outloud every morning 5 times)