Menu

#9 Patch for adding support for writing form submissions to CSV

closed
None
5
2012-05-18
2008-02-28
No

I needed to be able to write form submissions to a CSV file for backup and data manipulation. The following patch does the job.

NOTES:

  1. It requires Text::CSV be availble
  2. A new config parameter called 'csv_file' is expected with the path to write the file to
  3. A header line is only output if the file exists and size is 0
  4. If you change your form, you should reset your csv file. No warnings are in place to let you know that changes are happening.

Discussion

  • William McKee

    William McKee - 2008-02-28

    CGI::NMS::Script::FormMail.pm diff

     
  • William McKee

    William McKee - 2008-02-28

    Logged In: YES
    user_id=224605
    Originator: YES

    In addition, if you want fields like 'email' to come through into the csv file, you need to add include_config_NAME. Here's an example of a %more_config settings for setting the csv_file and include:

    %more_config = (
    'csv_file' => '/home/garlicgold/public_html/cgi/sample_form_db.csv',
    'include_config_email' => 1,
    );

     
  • Dave Cross

    Dave Cross - 2008-03-02

    Logged In: YES
    user_id=34146
    Originator: NO

    I'm not going to add this patch as it's outside the scope of a Formmail program, and this functionality is already available in TFMail (which we'd like to encourage people to use).

     

Log in to post a comment.