I've just started using GravityForms, and am puzzled about how to attach a file to a user notification. I've been to the page describing gform_user_notification_attachments, but the example there is for attaching files just uploaded. What I want to do is to attach files that are in the media library.
I created the following bit of code and inserted it into functions.php:
add_filter("gform_user_notification_attachments_1", "add_attachment", 10, 3);
function add_attachment($attachments, $lead, $form){
$attachments = array();
$attachments[] = '/wp-content/uploads/2013/02/digital-marketing-checklist-from-pv.pdf';
return $attachments;
}
Unfortunately, this isn't doing what I was hoping it would do, i.e. attach this file to the user notification. Do you have any idea what I'm doing wrong here?
Also, I'd like to add some logic to download different files based on the value of one of the form fields. Can you give me a hint as to how to do that?
Thanks, Dan