Hello,
I need help, because I dont know how to create csv file from submissions and send it as attachment in submission mail.

I have form with some field and after sending webform I need to create custom csv in specific format with values from webform and all this send it like attachment of normal submission mail.

Is there some modul for creating csv from webform, or I need to cook my own custom module to create it?
Thanks a lot

Comments

quicksketch’s picture

Category: task » support

Webform does not have built-in functionality to attach CSVs to e-mails that are sent. If you'd like to do this, you'll need to use a custom module (or maybe a contrib solution already exists, I don't know). Webform does set you up nicely to do this however. You can use the webform_results_export() function to generate a CSV file on the fly, save it to disk, and then use hook_mail_alter() to attach the resulting file to an e-mail. In order to send attachments of any kind, you need to have installed the MIME Mail module, which adds support for attachments to e-mails.

scooti’s picture

thanks a lot quicksketch. I'm starting to learn drupal module development :)

Nice day

quicksketch’s picture

Status: Active » Closed (fixed)

Thanks for the followup! Closing up.

M12K’s picture

Issue summary: View changes