<?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: Dynamically Email Current Author</title>
		<link>https://legacy.forums.gravityhelp.com/topic/dynamically-email-current-author</link>
		<description>Gravity Support Forums Topic: Dynamically Email Current Author</description>
		<language>en-US</language>
		<pubDate>Sat, 04 Apr 2026 09:05:15 +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/dynamically-email-current-author" rel="self" type="application/rss+xml" />

		<item>
			<title>iamdangavin on "Dynamically Email Current Author"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/dynamically-email-current-author#post-26766</link>
			<pubDate>Wed, 01 Jun 2011 20:27:45 +0000</pubDate>
			<dc:creator>iamdangavin</dc:creator>
			<guid isPermaLink="false">26766@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Awesome. Thanks David!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Smith on "Dynamically Email Current Author"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/dynamically-email-current-author#post-26699</link>
			<pubDate>Wed, 01 Jun 2011 11:32:52 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">26699@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Looks good, Dan!&#60;/p&#62;
&#60;p&#62;The only issue I saw (and this was actually due to a small error in the documentation) is that it is not the &#60;strong&#62;$form&#60;/strong&#62; object that is passed to this hook but the &#60;strong&#62;$lead&#60;/strong&#62;.&#60;/p&#62;
&#60;p&#62;This means you don't have to worry about getting the variable form the $_POST, you can get it straight from the $lead like so:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;[php]
$email = $lead[&#38;#39;5&#38;#39;];&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Nice work! :)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>iamdangavin on "Dynamically Email Current Author"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/dynamically-email-current-author#post-26673</link>
			<pubDate>Tue, 31 May 2011 21:22:46 +0000</pubDate>
			<dc:creator>iamdangavin</dc:creator>
			<guid isPermaLink="false">26673@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Okay turns out I figured it out about 15 mins after I posted here... This might not be the best solution, but it is working!&#60;/p&#62;
&#60;p&#62;I am assuming you have this on your author page: &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;$curauth = (isset($_GET[&#38;#39;author_name&#38;#39;])) ? get_user_by(&#38;#39;slug&#38;#39;, $author_name) : get_userdata(intval($author));&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;First, you need to create a hidden field in your form:&#60;/p&#62;
&#60;p&#62;- Edit your Form&#60;br /&#62;
- Add a hidden field you want to populate and give it a name&#60;br /&#62;
- Edit the hidden field&#60;br /&#62;
- Select the Advanced tab&#60;br /&#62;
- Select the &#34;Allow field to be populated dynamically&#34; checkbox&#60;br /&#62;
- Give the field a parameter name, this parameter name is used to target the field so name it something simple like &#34;email&#34; or something similar.&#60;br /&#62;
- Save your form&#60;/p&#62;
&#60;p&#62;Then you would use the gform_field_value hook by adding custom code in your themes functions.php file to dynamically populate that field. For example, if you set the parameter to &#34;email&#34; your code would look like this:&#60;/p&#62;
&#60;p&#62;in your functions.php file add this:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;// NO ID after value_email
add_filter( &#38;#39;gform_field_value_email&#38;#39;, &#38;#39;populate_email&#38;#39; );
function populate_email(){
 global $curauth;
	return $curauth-&#38;gt;user_email;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;and then again in your functions.php file add this:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;// update the &#38;#39;1&#38;#39; to the ID of your form
add_filter(&#38;quot;gform_notification_email_1&#38;quot;, &#38;quot;change_notification_email&#38;quot;, 10, 2);
function change_notification_email($email, $form){

    // update the &#38;#39;5&#38;#39; to the ID of your field
    $email = $_POST[&#38;#39;input_5&#38;#39;];

    return $email;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Remember to change your ID's to reflect your form.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>iamdangavin on "Dynamically Email Current Author"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/dynamically-email-current-author#post-26635</link>
			<pubDate>Tue, 31 May 2011 10:51:53 +0000</pubDate>
			<dc:creator>iamdangavin</dc:creator>
			<guid isPermaLink="false">26635@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi, I am trying to use the route notification hook to dynamically send the form to the Current Authors Page. To be clear I do not mean the current Posts Author, but if I were to go to the authors profile page: &#60;a href=&#34;http://mysite.com/author/dangavin&#34; rel=&#34;nofollow&#34;&#62;http://mysite.com/author/dangavin&#60;/a&#62; I would see an email form that I can fill out and send to this author.&#60;/p&#62;
&#60;p&#62;I have found the hook and have tried multiple variations, but with no luck. any ideas?&#60;/p&#62;
&#60;p&#62;I am passing this on the author template already:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;$curauth = (isset($_GET[&#38;#39;author_name&#38;#39;])) ? get_user_by(&#38;#39;slug&#38;#39;, $author_name) : get_userdata(intval($author));&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;So I was hoping something like this would work... but no luck&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_filter( &#38;#39;gform_notification_email_1&#38;#39;, &#38;#39;route_notification&#38;#39; );
function route_notification($email_to) {
    global $post;
    $email_to = $curauth-&#38;gt;user_email;
    return $email_to;
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>

	</channel>
</rss>
