Referencing this thread: http://www.gravityhelp.com/forums/topic/use-pre-selected-file-as-user-notification-attachment
And this code specifically:
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["basedir"];
$attachments = array();
//add a file from the uploads folder
$attachments[] = $upload_path . "/my_file.jpg";
return $attachments;
}
This function is working properly, but I need to specify the attachment is only attached to confirmations for a single form. How can I do that?