How to attach external file to admin notification? [RESOLVED]

Hi

I am doing something very similar to a://community.gravityforms.com/t/create-update-csv-on-form-submission-resolved/570/6. However I have not been able to attach a file to the form.

Note: The form itself does not have an attachment/file upload in it.

However I have not been able to attach a file to the form.

Note: The form itself does not have an attachment/file upload in it.

Could you clarify what you’re trying to do? From the above quote, it sounds like you are wanting the end user to have the ability to attach files to the form. Is that correct?

If you need help with creating/updating a CSV file based on submissions, I’d be more than glad to help.

Yes please. What is the end goal? Can you explain in more detail so we have a chance at giving a good answer? Thank you.

Sorry, I have not been clear. Here it goes.

I am setting up a form which when submitted attaches a CSV along with the admin notification email; the CSV is generated based on the form inputs and is hooked into gform_pre_submission.

So far I am able to create the CSV file (which happens in the background during submission).

The issue I am having is, I don’t know how to attach the file to the admin notification email.

I hope this clears up what I am trying to do. :slight_smile:

Ideally, you can use gform_notifications, rather than gform_pre_submission. That way, you can create the file and attach it at the same time. (you would use the $entry rather than the $_POST to get your values from the submission).

You can use the gform_notification filter like this to attach the file:

That example is far more than you need, since you’re not testing the submission for the uploaded files. You are simply going to be attaching the CSV file you created. The code will look more like this:

Great!
Thank you for the swift response.
Trying it now

It worked perfectly! Thanks again

Thanks for the update!