Export and send a form submission each time a form is submitted


(M L Sanders) #1

Matrix 5.3.3.0

Hi All
Is there a way to send an exported CSV of a form submission as soon as that submission is created?

Ideally, I’d like to attach the submission csv to the Recipient email.

I know I can set up cron jobs to send submissions every 24 hours, but most of the time I’d be sending empty spreadsheets!! I only want to export and send the spreadsheet when a new submission is made.

thanks
mark


#2

Hi Mark, have a look at “Custom File Attachments” on the “Email Options” screen - https://matrix.squiz.net/manuals/custom-form/chapters/form-contents#custom-file-attachments


(M L Sanders) #3

Hi Jason
Yes, I played with this, but can’t see how I’d send (as an attachment) a form submission exported as CSV.

mark


(Peter McLeod) #4

Hi

Yep, do as Jason suggested.

You’ll need to set up a listing that gets the form data - set it to get 1 asset per page and sort by asset created descending, or pass it the id of the newly created for submission if possible.

I’m sure there are other topics on listing form submissions either on this forum or the community site.

Then the just point the file attachment to the listing asset as described in the link Jason provided.

Also would need to set a design to the listing that only outputs the asset body copy, and a text/csv mime (though might work without the needing the mime type).

Thanks
Peter