<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Gravity Support Forums Topic: Use pre-selected file as user notification attachment</title>
		<link>https://legacy.forums.gravityhelp.com/topic/use-pre-selected-file-as-user-notification-attachment</link>
		<description>Gravity Support Forums Topic: Use pre-selected file as user notification attachment</description>
		<language>en-US</language>
		<pubDate>Sun, 19 Apr 2026 20:04:37 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>https://legacy.forums.gravityhelp.com/search.php</link>
		</textInput>
		<atom:link href="https://legacy.forums.gravityhelp.com/rss/topic/use-pre-selected-file-as-user-notification-attachment" rel="self" type="application/rss+xml" />

		<item>
			<title>jonny on "Use pre-selected file as user notification attachment"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/use-pre-selected-file-as-user-notification-attachment#post-53840</link>
			<pubDate>Fri, 30 Mar 2012 07:12:45 +0000</pubDate>
			<dc:creator>jonny</dc:creator>
			<guid isPermaLink="false">53840@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Great stuff, Alex, thank you - that works perfectly :o)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Elena on "Use pre-selected file as user notification attachment"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/use-pre-selected-file-as-user-notification-attachment#post-53833</link>
			<pubDate>Fri, 30 Mar 2012 05:50:29 +0000</pubDate>
			<dc:creator>Elena</dc:creator>
			<guid isPermaLink="false">53833@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Alex: so beautifully working on our sites!!&#60;br /&#62;
Thanks guys, you rock!&#60;/p&#62;
&#60;p&#62;E.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Alex Cancado on "Use pre-selected file as user notification attachment"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/use-pre-selected-file-as-user-notification-attachment#post-53767</link>
			<pubDate>Thu, 29 Mar 2012 10:08:20 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">53767@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Sorry. There was a small problem with the code I posted earlier. Here it is again (this time it should work)&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;quot;gform_user_notification_attachments&#38;quot;, &#38;quot;add_attachment&#38;quot;, 10, 3);
function add_attachment($attachments, $lead, $form){

    //getting wordpress upload folder
    $upload = wp_upload_dir();
    $upload_path = $upload[&#38;quot;basedir&#38;quot;];

    $attachments = array();

    //add a file from the uploads folder
    $attachments[] = $upload_path . &#38;quot;/my_file.jpg&#38;quot;;

    return $attachments;
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>jonny on "Use pre-selected file as user notification attachment"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/use-pre-selected-file-as-user-notification-attachment#post-53742</link>
			<pubDate>Thu, 29 Mar 2012 05:20:12 +0000</pubDate>
			<dc:creator>jonny</dc:creator>
			<guid isPermaLink="false">53742@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;bumping post - alex, have you had any further ideas as to why that code might not work?&#60;/p&#62;
&#60;p&#62;thanks,&#60;/p&#62;
&#60;p&#62;Jon.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>jonny on "Use pre-selected file as user notification attachment"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/use-pre-selected-file-as-user-notification-attachment#post-53565</link>
			<pubDate>Tue, 27 Mar 2012 08:41:24 +0000</pubDate>
			<dc:creator>jonny</dc:creator>
			<guid isPermaLink="false">53565@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi - same as JenF:&#60;/p&#62;
&#60;p&#62;add_filter(&#34;gform_user_notification_attachments_6&#34;, &#34;add_attachment&#34;, 10, 3);&#60;br /&#62;
function add_attachment($attachments, $lead, $form){&#60;br /&#62;
    //getting wordpress upload folder&#60;br /&#62;
    $upload = wp_upload_dir();&#60;br /&#62;
    $upload_path = $upload[&#34;path&#34;];&#60;br /&#62;
    $attachments = array();&#60;br /&#62;
    //add a file from the uploads folder&#60;br /&#62;
    $attachments[] = $upload_path . &#34;/2012/03/Easy-Quote-16032012.xlsx&#34;;&#60;br /&#62;
    return $attachments;&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;The user notification mail is sent but no attachment:
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Elena on "Use pre-selected file as user notification attachment"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/use-pre-selected-file-as-user-notification-attachment#post-53456</link>
			<pubDate>Mon, 26 Mar 2012 13:00:03 +0000</pubDate>
			<dc:creator>Elena</dc:creator>
			<guid isPermaLink="false">53456@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi&#60;/p&#62;
&#60;p&#62;I think I am in the same situation. If I paste that code (changing the file, of course), it gives me a syntax error and site is broken.&#60;/p&#62;
&#60;p&#62;I need to include a pdf file in the automatic response sent to users that fill in a given form on our site. So the response comes with some text blah blah and the pdf attached.&#60;/p&#62;
&#60;p&#62;That'd save us tons of time of manually replying to users with the pdf. We can't give a link, we need to collect the emails, and the link can be easily shared.&#60;/p&#62;
&#60;p&#62;Thanks a lot, as usual!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>JenF on "Use pre-selected file as user notification attachment"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/use-pre-selected-file-as-user-notification-attachment#post-53184</link>
			<pubDate>Thu, 22 Mar 2012 11:37:32 +0000</pubDate>
			<dc:creator>JenF</dc:creator>
			<guid isPermaLink="false">53184@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;I tried using the code you sent but the form is not attaching my file to the user notification email. The user notification email goes out, but there's no file attached.&#60;/p&#62;
&#60;p&#62;Here's my demo page:&#60;br /&#62;
&#60;a href=&#34;http://archwebmarketing.com/nice-to-meet-you-2/&#34; rel=&#34;nofollow&#34;&#62;http://archwebmarketing.com/nice-to-meet-you-2/&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Below is the code I added to my functions.php file (the form I'm using is ID 2). Any help would be greatly apprceiated!&#60;/p&#62;
&#60;p&#62;add_filter(&#34;gform_user_notification_attachments_2&#34;, &#34;add_attachment&#34;, 10, 3);&#60;br /&#62;
function add_attachment($attachments, $lead, $form){&#60;/p&#62;
&#60;p&#62;    //getting wordpress upload folder&#60;br /&#62;
    $upload = wp_upload_dir();&#60;br /&#62;
    $upload_path = $upload[&#34;path&#34;];&#60;/p&#62;
&#60;p&#62;    $attachments = array();&#60;/p&#62;
&#60;p&#62;    //add a file from the uploads folder&#60;br /&#62;
    $attachments[] = $upload_path . &#34;/2012/JenniferFeurer.vcf&#34;;&#60;/p&#62;
&#60;p&#62;    return $attachments;&#60;/p&#62;
&#60;p&#62;}
&#60;/p&#62;</description>
		</item>
		<item>
			<title>JenF on "Use pre-selected file as user notification attachment"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/use-pre-selected-file-as-user-notification-attachment#post-52164</link>
			<pubDate>Mon, 12 Mar 2012 17:19:50 +0000</pubDate>
			<dc:creator>JenF</dc:creator>
			<guid isPermaLink="false">52164@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Fantastic! Thanks so much for the quick reply. I'll try this out and report back if I have any trouble getting it to work.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Alex Cancado on "Use pre-selected file as user notification attachment"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/use-pre-selected-file-as-user-notification-attachment#post-52162</link>
			<pubDate>Mon, 12 Mar 2012 17:12:45 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">52162@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;The following code snippet should point you in the right direction. Place it in your theme's function.php file.&#60;br /&#62;
&#60;a href=&#34;http://pastie.org/3580604&#34; rel=&#34;nofollow&#34;&#62;http://pastie.org/3580604&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>JenF on "Use pre-selected file as user notification attachment"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/use-pre-selected-file-as-user-notification-attachment#post-52160</link>
			<pubDate>Mon, 12 Mar 2012 16:42:46 +0000</pubDate>
			<dc:creator>JenF</dc:creator>
			<guid isPermaLink="false">52160@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I'd like to use the new User Notification Attachment feature to automatically send a file to anyone who submits their email address through my form.&#60;/p&#62;
&#60;p&#62;The instructions for using this hook show how to attach a file when that file was uploaded through the original form. (&#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Gform_user_notification_attachments&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Gform_user_notification_attachments&#60;/a&#62;) &#60;/p&#62;
&#60;p&#62;In my case, I'd like to set up my form so that when they send me their email address (which is the only form field), the user notification gets sent out with a pre-defined file attached to it. That file would be located in my WordPress uploads folder.&#60;/p&#62;
&#60;p&#62;Unfortunately, I'm not a programmer so trying to customize the code is beyond my skillset.&#60;/p&#62;
&#60;p&#62;Can anyone show me how to customize the code shown in the link below so that it attaches a specific file (or even files) instead of requiring the files to be uploaded with the form?&#60;br /&#62;
&#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Gform_user_notification_attachments&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Gform_user_notification_attachments&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Thanks so much!
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
