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.

Attaching PDF to User Notification Clarification

  1. I've seen this very helpful post here: http://www.gravityhelp.com/forums/topic/use-pre-selected-file-as-user-notification-attachment#post-53767

    but, how do I set this up for a specific form? I see where to change the file link. For example, I'm using this for form #19. Where do I put that in the code? Thanks!

    Posted 11 years ago on Tuesday October 23, 2012 | Permalink
  2. David Peralty

    You should be able to do an if statement to test for the form number early on. Something like:
    if($form["id"] = 19)

    Posted 11 years ago on Tuesday October 23, 2012 | Permalink
  3. Hi, I'm using the code below to send out a standard attachment with each user notification. The notifications get sent out, however, with no attachment. Any idea what I'm doing wrong?

    # add attachment feature to user notification
    add_filter("gform_user_notification_attachments", "add_attachment", 10, 3);
    function add_attachment($attachments, $lead, $form){
    
        //getting wordpress upload folder
        $upload = wp_upload_dir();
        $upload_path = $upload["/var/www/2xy/data/www/messagehouse_2012/wordpress/wp-content/uploads/temp"];
    
        $attachments = array();
    
        //add a file from the uploads folder
        $attachments[] = $upload_path . "/test.pdf";
    
        return $attachments;
    }
    Posted 11 years ago on Wednesday November 14, 2012 | Permalink
  4. David, it looks like you were able to resolve your issue, based on this?

    http://www.gravityhelp.com/forums/topic/simple-user-notification-attachments#post-91150

    Posted 11 years ago on Saturday November 17, 2012 | Permalink
  5. Yes. Thank you.

    Posted 11 years ago on Saturday November 17, 2012 | Permalink
  6. Thanks for the update. We'll close this one.

    Posted 11 years ago on Saturday November 17, 2012 | Permalink

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