PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Sending CSV attachment on form submit

  1. Would like to purchase developer version.

    But as confirmation email is sent to client, is it possible to attach a csv to this email with only certain fields included?

    If not, is there an alternative feature you can suggest?

    Posted 8 years ago on Friday June 8, 2012 | Permalink
  2. You can create a custom CSV and send that as an attachment to the email. You would use a couple of filters and hooks which are built in to Gravity Forms. Specifically, gform_after_submission and gform_user_notification_attachments.

    You would create your custom CSV using a subset of the data which was submitted, then you would attach the CSV to the user notification.

    What you want to accomplish is possible using built-in Gravity Forms and WordPress/PHP functions.

    Posted 8 years ago on Monday June 11, 2012 | Permalink
  3. HI

    I have the following code to attach documents in my functions.php file, if I wanted to add a file ID with the csv attached how would I amend the code so that it still sends these files and the csv to another form, for example form 1?
    CODE in functions.php:

    add_filter("gform_user_notification_attachments", "add_attachment", 10, 3);
    function add_attachment($attachments, $lead, $form) {
        if ( $form[ 'id' ] == 17 )  {
            $doc = '/The-Membership-Rules.pdf';
        } elseif( $form[ 'id' ] == 22 ) {
            $doc = '/The-Membership-Rules.pdf';
        } else {
          $doc = '';
        $upload = wp_upload_dir();
        $upload_path = $upload["basedir"];
        $attachments = array();
        $attachments[] = $upload_path . $doc;
        return $attachments;


    Posted 8 years ago on Monday October 29, 2012 | Permalink
  4. Please begin a new topic in the regular support forums. We don't normally handle support in the pre-purchase forums. Thank you.

    Posted 8 years ago on Monday October 29, 2012 | Permalink

This topic has been resolved and has been closed to new replies.