The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $newpmmsg - Line: 40 - File: global.php(841) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/global.php(841) : eval()'d code 40 errorHandler->error
/global.php 841 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 909 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1370 fetch_forum_permissions
/printthread.php 76 forum_permissions
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
csv file on submit - Printable Version

+- Form Tools (https://forums.formtools.org)
+-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1)
+--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5)
+--- Thread: csv file on submit (/showthread.php?tid=1172)



csv file on submit - sallymander - Apr 12th, 2011

is there a way to have a csv file sent to the administrator/client on submit?

I have set 2 forms up, basic and with API, but i can't figure out if the above is possible. data from forms needs to be imported into FileManager and this would save a step.

thanks!
Sally


RE: csv file on submit - Ben - Apr 30th, 2011

Hi Sally,

Sorry I never got back to this. The next few days I'll finally be catching up in the forums - exciting! Smile

Technically, yes this is doable - but it would definitely take a some legwork and some PHP knowledge. Here's the general idea: first you'd need to be using the Swift Mailer module to send your emails via SMTP. That module lets you include file attachments. See here for more info on that:
http://modules.formtools.org/swift_mailer/?page=file_attachments

Then - and this is the tricky bit - you'd need to trigger the creation of the csv file on form submit. There's nothing built-in to allow for this, but I think it's hackable.... The Submission Pre-Parser module lets you execute arbitrary code when the form is submitted:
http://modules.formtools.org/submission_pre_parser/

What I'd try is first configuring a new Export Manager CSV field type that's told to create the file on the server (with a predefined filename). Then, in the Submission Pre-Parser rule, maybe use CURL to call the URL that generates the file.

Lastly, using the info in that doc page above, add the file attachment to the email template.

Sorry it's such high-level technical info, but I just wanted to outline my suggested approach. But yes, you'd definitely need a PHP developer handy to work it all through. Sorry I couldn't be more help!

All the best -

Ben