Feature #27767
csv - file attachment
| Status: | Closed | Start date: | 2011-06-29 | |
|---|---|---|---|---|
| Priority: | Should have | Due date: | ||
| Assignee: | Reinhard Führicht | % Done: | 100% |
|
| Category: | Finisher | |||
| Target version: | Stable v1.0 | |||
| Votes: | 0 |
Description
There should be a way to put the csv file as an mail attachment for email messages within the Finisher section of the TS config like "attachPDF".
Associated revisions
Make CSV files attachable to an email (resolves #27767). Warning: The TS setting "attachPDF" got removed in favor of "attachGeneratedFiles". See manual for details.
Make CSV files attachable to an email (resolves #27767). Warning: The TS setting "attachPDF" got removed in favor of "attachGeneratedFiles". See manual for details.
History
Updated by Reinhard Führicht almost 2 years ago
- File 27767.patch added
- Status changed from New to Needs Feedback
- % Done changed from 0 to 70
Attached patch changes the following:
- Remove the setting "attachPDF" in favor of the new setting "attachGeneratedFiles". "attachGeneratedFiles" is an array of classes and configuration just like Finishers, PreProcessors, ...
Example:
1.class = Finisher_Mail
1.config {
admin {
sender_email = asdf@asdf.at
to_email = asdf@asdf.at
subject = Email subject
attachment = picture
attachGeneratedFiles {
1.class = Generator_Csv
1.config {
exportParams = email, name, message
delimiter = ;
enclosure = "
returnFileName = 1
}
}
}
}
- Add TypoScript options "returnFileName", "customTempOutputPath" and "filePrefix" like Generator_TcPdf has.
- Add TypoScript options "delimiter" and "enclosure".
Please review and let me know, if this is OK for you.
Updated by Thomas almost 2 years ago
Hi, here is my report:
Problems with the patch file (!)
patch file in the root directory of the TYPO3 installation
system('patch -p0 --dry-run < 27767.patch');
"patching file /home/rf/workspace/Formhandler/Classes/Finisher/Tx_Formhandler_Finisher_Mail.php Hunk #1 FAILED at 266. Hunk #2 FAILED at 494. Hunk #3 FAILED at 551."
I dont know about the directory structure of "/home/rf/workspace/", what do i wrong?
Then i change the the code manually.
With this Finsher TS i have trouble:
- Finishers configuration
finishers {
1.class = Finisher_Mail
1.config {
admin {
sender_email = zvk_test@--change--.de
to_email = zvk_test@--change--.de
subject = Email subject
attachment = picture
attachGeneratedFiles {
1.class = Generator_Csv
1.config {
exportParams = email, username, lv
delimiter = ;
enclosure = "
customTempOutputPath = uploads/formhandler/tmp2/
filePrefix = mitgliedsdaten_
storeInTempFile =1
returnFileName = 1
}
}
}
}
}# finishers
Fatal error: Call to a member function prepareClassName() on a non-object in /var/www/typo3conf/ext/formhandler/Classes/Finisher/Tx_Formhandler_Finisher_Mail.php on line 562 Call Stack: 0.0002 684752 1. {main}() /usr/share/typo3/typo3_src-4.5.3/index.php:0 0.0009 927184 2. require('/usr/share/typo3/typo3_src-4.5.3/typo3/sysext/cms/tslib/index_ts.php') /usr/share/typo3/typo3_src-4.5.3/index.php:84 0.7806 44776768 3. tslib_fe->INTincScript() /usr/share/typo3/typo3_src-4.5.3/typo3/sysext/cms/tslib/index_ts.php:465 0.7832 45415784 4. tslib_fe->INTincScript_process() /usr/share/typo3/typo3_src-4.5.3/typo3/sysext/cms/tslib/class.tslib_fe.php:3202 0.7853 45807512 5. tslib_cObj->USER /usr/share/typo3/typo3_src-4.5.3/typo3/sysext/cms/tslib/class.tslib_fe.php:3263 0.7853 45808368 6. tslib_content_User->render() /usr/share/typo3/typo3_src-4.5.3/typo3/sysext/cms/tslib/class.tslib_content.php:922 0.7854 45814040 7. tslib_cObj->callUserFunction() /usr/share/typo3/typo3_src-4.5.3/typo3/sysext/cms/tslib/content/class.tslib_content_user.php:51 0.7855 45823832 8. call_user_func_array() /usr/share/typo3/typo3_src-4.5.3/typo3/sysext/cms/tslib/class.tslib_content.php:6348 0.7855 45823896 9. tx_formhandler_pi1->main() /usr/share/typo3/typo3_src-4.5.3/typo3/sysext/cms/tslib/class.tslib_content.php:6348 0.7856 45831432 10. Tx_Formhandler_Dispatcher->main() /var/www/typo3conf/ext/formhandler/pi1/class.tx_formhandler_pi1.php:48 0.7935 46914776 11. Tx_Formhandler_Controller_Form->process() /var/www/typo3conf/ext/formhandler/Classes/Controller/Tx_Formhandler_Dispatcher.php:96 0.8182 61278368 12. Tx_Formhandler_Controller_Form->processSubmitted() /var/www/typo3conf/ext/formhandler/Classes/Controller/Tx_Formhandler_Controller_Form.php:193 0.8335 61801968 13. Tx_Formhandler_Controller_Form->processFinished() /var/www/typo3conf/ext/formhandler/Classes/Controller/Tx_Formhandler_Controller_Form.php:341 0.8435 61873272 14. Tx_Formhandler_Finisher_Mail->init() /var/www/typo3conf/ext/formhandler/Classes/Controller/Tx_Formhandler_Controller_Form.php:428 0.8435 61873272 15. Tx_Formhandler_Finisher_Mail->parseEmailSettings() /var/www/typo3conf/ext/formhandler/Classes/Finisher/Tx_Formhandler_Finisher_Mail.php:458 0.8435 61878640 16. Tx_Formhandler_Finisher_Mail->parseEmailSettingsByType() /var/www/typo3conf/ext/formhandler/Classes/Finisher/Tx_Formhandler_Finisher_Mail.php:506 Variables in local scope (#16): $currentSettings = array ('sender_email' => 'zvk_test@--change--.de', 'to_email' => 'zvk_test@--change--.de', 'subject' => 'Email subject', 'attachment' => 'picture', 'attachGeneratedFiles.' => array ('1.' => array (...))) $emailSettings = array ('sender_email' => array (0 => 'zvk_test@--change--.de'), 'to_email' => array (0 => 'zvk_test@--change--.de'), 'subject' => 'Email subject', 'attachment' => array (0 => 'picture'), 'attachGeneratedFiles.' => array ('1.' => array (...)), 'sender_name' => NULL, 'replyto_email' => array (0 => ''), 'replyto_name' => NULL, 'cc_email' => array (0 => ''), 'cc_name' => NULL, 'bcc_email' => array (0 => ''), 'bcc_name' => NULL, 'to_name' => array (0 => ''), 'return_path' => array (0 => '')) $file = uninitialized $generator = uninitialized $generatorClass = 'Generator_Csv' $idx = '1.' $option = 'attachGeneratedFiles' $options = array ('class' => 'Generator_Csv', 'config.' => array ('exportParams' => 'email, username, lv', 'delimiter' => ';', 'enclosure' => '"', 'customTempOutputPath' => 'uploads/formhandler/tmp2/', 'filePrefix' => 'mitgliedsdaten_', 'storeInTempFile' => '1', 'returnFileName' => '1')) $optionsToParse = array (0 => 'filePrefix', 1 => 'to_email', 2 => 'subject', 3 => 'sender_email', 4 => 'sender_name', 5 => 'replyto_email', 6 => 'replyto_name', 7 => 'cc_email', 8 => 'cc_name', 9 => 'bcc_email', 10 => 'bcc_name', 11 => 'to_name', 12 => 'return_path', 13 => 'attachment', 14 => 'attachGeneratedFiles', 15 => 'htmlEmailAsAttachment', 16 => 'plain.', 17 => 'html.') $section = 'sEMAILADMIN' $type = 'admin' $typeLower = 'admin' $typeUpper = 'ADMIN' $value = NULL
Please give me a hint, what is wrong here.
Best regards
Thomas
Updated by Reinhard Führicht almost 2 years ago
The fatal error seems to occur because you do not use the current trunk version from SVN.
I just tested the patch and it works for me. Please update your Formhandler version.
Regarding the /home/rf/workspace:
This is just my local path to Formhandler. You can replace the path with your local path.
Updated by Thomas almost 2 years ago
Hello,
of course you are right ;-)
Now it's works for me too with the current trunk version from SVN (v0.9.15dev) and manually patched.
Thank you for your support, nice work.
Best Regards
Thomas
Updated by Reinhard Führicht almost 2 years ago
- Status changed from Needs Feedback to Resolved
- % Done changed from 70 to 100
Applied in changeset r50194.
Updated by Thomas over 1 year ago
- Status changed from Resolved to New
Hello,
when i'm using the csv export the "exportParams" were in the csv-file, but i am missing the table fields (first line fields) for the exported values.
Is there any way to put the first line (header?) on?
Best regards
Thomas
Updated by Reinhard Führicht over 1 year ago
- Status changed from New to Closed
Hi Thomas.
Currently, this is not possible.
I will add a TypoScript option to enable this.
To keep the issues separated I will open a new issue for this request.