<?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: Attach File to Email Notification (rather than including a url)</title>
		<link>https://legacy.forums.gravityhelp.com/topic/attach-file-to-email-notification-rather-than-including-a-url</link>
		<description>Gravity Support Forums Topic: Attach File to Email Notification (rather than including a url)</description>
		<language>en-US</language>
		<pubDate>Tue, 21 Apr 2026 03:12:10 +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/attach-file-to-email-notification-rather-than-including-a-url" rel="self" type="application/rss+xml" />

		<item>
			<title>Chris Hajer on "Attach File to Email Notification (rather than including a url)"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/attach-file-to-email-notification-rather-than-including-a-url#post-73571</link>
			<pubDate>Sun, 02 Sep 2012 00:53:13 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">73571@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thank you for the update.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Actsoft on "Attach File to Email Notification (rather than including a url)"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/attach-file-to-email-notification-rather-than-including-a-url#post-73488</link>
			<pubDate>Fri, 31 Aug 2012 15:44:33 +0000</pubDate>
			<dc:creator>Actsoft</dc:creator>
			<guid isPermaLink="false">73488@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;THANK YOU for this! Glad that worked ...
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Peralty on "Attach File to Email Notification (rather than including a url)"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/attach-file-to-email-notification-rather-than-including-a-url#post-73455</link>
			<pubDate>Fri, 31 Aug 2012 11:09:47 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">73455@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Actsoft you want to use the admin attachments hook. Change user to admin in your code.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Actsoft on "Attach File to Email Notification (rather than including a url)"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/attach-file-to-email-notification-rather-than-including-a-url#post-73451</link>
			<pubDate>Fri, 31 Aug 2012 11:03:06 +0000</pubDate>
			<dc:creator>Actsoft</dc:creator>
			<guid isPermaLink="false">73451@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Relevant screenshot: &#60;a href=&#34;http://www.actsoft.com/wp-content/uploads/2012/08/gravity-forms.jpg&#34; rel=&#34;nofollow&#34;&#62;http://www.actsoft.com/wp-content/uploads/2012/08/gravity-forms.jpg&#60;/a&#62;&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;/* ---------------------------------------------------------------- */
/*	Include  Form Attachments in Notification Emails			*/
/* ---------------------------------------------------------------- */
add_filter(&#38;quot;gform_user_notification_attachments&#38;quot;, &#38;quot;add_attachment&#38;quot;, 10, 3);

function add_attachment($attachments, $lead, $form){
    $fileupload_fields = GFCommon::get_fields_by_type($form, array(&#38;quot;fileupload&#38;quot;));
    if(!is_array($fileupload_fields))
        return $attachments;
    $attachments = array();
    $upload_root = RGFormsModel::get_upload_root();
    foreach($fileupload_fields as $field){
        $url = $lead[$field[&#38;quot;id&#38;quot;]];
        $attachment = preg_replace(&#38;#39;&#124;^(.*?)/gravity_forms/&#124;&#38;#39;, $upload_root, $url);
        if($attachment){
            $attachments[] = $attachment;
        }
    }
    return $attachments;
}

/* ---------------------------------------------------------------- */&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;&#60;a href=&#34;http://pastebin.com/EFGyPhxx&#34; rel=&#34;nofollow&#34;&#62;http://pastebin.com/EFGyPhxx&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Peralty on "Attach File to Email Notification (rather than including a url)"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/attach-file-to-email-notification-rather-than-including-a-url#post-73448</link>
			<pubDate>Fri, 31 Aug 2012 10:48:40 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">73448@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;985 - can you please post your functions.php file so I can take a look?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Peralty on "Attach File to Email Notification (rather than including a url)"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/attach-file-to-email-notification-rather-than-including-a-url#post-73447</link>
			<pubDate>Fri, 31 Aug 2012 10:47:14 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">73447@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;In your notifications, the email that goes to hr, is it the admin notification or the user notification? Because you might just have the hook wrong. We have one for admin notifications and one for user notifications.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Actsoft on "Attach File to Email Notification (rather than including a url)"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/attach-file-to-email-notification-rather-than-including-a-url#post-73441</link>
			<pubDate>Fri, 31 Aug 2012 10:09:24 +0000</pubDate>
			<dc:creator>Actsoft</dc:creator>
			<guid isPermaLink="false">73441@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Can we get some clarity on this post? I can't seem to make this work either and it's very frustrating. This should be a checkbox in the module config, not a manual code entry in functions.php.&#60;/p&#62;
&#60;p&#62;My situation: I have a form for people to submit resume for careers page. Notification goes to HR, but link isn't downloadable for them (permissions) so I just want to attach to the notification email. I copy and pasted exactly from:&#60;/p&#62;
&#60;p&#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;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){
    $fileupload_fields = GFCommon::get_fields_by_type($form, array(&#38;quot;fileupload&#38;quot;));
    if(!is_array($fileupload_fields))
        return $attachments;
    $attachments = array();
    $upload_root = RGFormsModel::get_upload_root();
    foreach($fileupload_fields as $field){
        $url = $lead[$field[&#38;quot;id&#38;quot;]];
        $attachment = preg_replace(&#38;#39;&#124;^(.*?)/gravity_forms/&#124;&#38;#39;, $upload_root, $url);
        if($attachment){
            $attachments[] = $attachment;
        }
    }
    return $attachments;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;What part of this do I need to customize? The common.php file was little help.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>985mediagroup on "Attach File to Email Notification (rather than including a url)"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/attach-file-to-email-notification-rather-than-including-a-url#post-69232</link>
			<pubDate>Thu, 02 Aug 2012 17:10:04 +0000</pubDate>
			<dc:creator>985mediagroup</dc:creator>
			<guid isPermaLink="false">69232@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I fixed the issue, not paying attention and left the &#38;lt;php in..&#60;/p&#62;
&#60;p&#62;but now i have the code in and im getting this error when forms are submitted. Attachment arent attached.&#60;/p&#62;
&#60;p&#62;[Thu Aug 02 16:42:53 2012] [error] [client 69.115.20.95] PHP Warning:  call_user_func_array() [&#60;a href='function.call-user-func-array' rel=&#34;nofollow&#34;&#62;function.call-user-func-array&#60;/a&#62;]: First argument is expected to be a valid callback, 'add_attachment' was given in /home2/dbrock/public_html/wp-includes/plugin.php on line 170, referer: &#60;a href=&#34;http://www.dbistaffing.com/submit-form/?job_title=Technical%20Writer&#38;amp;job_id=1859&#38;amp;job_email=Sheron@DBIStaffing.com&#34; rel=&#34;nofollow&#34;&#62;http://www.dbistaffing.com/submit-form/?job_title=Technical%20Writer&#38;amp;job_id=1859&#38;amp;job_email=Sheron@DBIStaffing.com&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Peralty on "Attach File to Email Notification (rather than including a url)"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/attach-file-to-email-notification-rather-than-including-a-url#post-69230</link>
			<pubDate>Thu, 02 Aug 2012 17:08:12 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">69230@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Looks like your theme's function file might have an issue in it on line 28. Can you post it on pastebin or something similar so we can take a look?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>985mediagroup on "Attach File to Email Notification (rather than including a url)"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/attach-file-to-email-notification-rather-than-including-a-url#post-69187</link>
			<pubDate>Thu, 02 Aug 2012 13:42:52 +0000</pubDate>
			<dc:creator>985mediagroup</dc:creator>
			<guid isPermaLink="false">69187@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I had the webhost edit the file and change the settings as per the site you sent.&#60;/p&#62;
&#60;p&#62;I'm still getting a 500 error/white screen, this time error log says..&#60;/p&#62;
&#60;p&#62;[Thu Aug 02 13:39:02 2012] [error] [client 96.57.25.218] PHP Parse error:  syntax error, unexpected '&#38;lt;' in /home2/dbrock/public_html/wp-content/themes/DBIStaffing/functions.php on line 28
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
