<?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: adding action</title>
		<link>https://legacy.forums.gravityhelp.com/topic/adding-action</link>
		<description>Gravity Support Forums Topic: adding action</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 06:27:36 +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/adding-action" rel="self" type="application/rss+xml" />

		<item>
			<title>jochan on "adding action"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/adding-action#post-5564</link>
			<pubDate>Tue, 18 May 2010 22:44:33 +0000</pubDate>
			<dc:creator>jochan</dc:creator>
			<guid isPermaLink="false">5564@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks for your help! It's all working now.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Alex Cancado on "adding action"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/adding-action#post-5245</link>
			<pubDate>Tue, 04 May 2010 21:00:02 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">5245@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;The keys for the $entry array are the field id without the &#34;input&#34; part. So, your firlst name should be $entry[&#34;5.3&#34;], and your last name $entry[&#34;5.6&#34;]. I see your newsletter question is a drop down, so you are right, use&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;if($entry[&#38;quot;11&#38;quot;] == &#38;quot;Yes&#38;quot;){
  //do something
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Good luck.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>jochan on "adding action"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/adding-action#post-5242</link>
			<pubDate>Tue, 04 May 2010 20:37:58 +0000</pubDate>
			<dc:creator>jochan</dc:creator>
			<guid isPermaLink="false">5242@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Thanks for your prompt reply... however I'm still a bit confused with the naming, this is my html&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;div class=&#38;#39;ginput_complex ginput_container&#38;#39; id=&#38;#39;input_1_5&#38;#39;&#38;gt;
            &#38;lt;span id=&#38;#39;input_1_5_3_container&#38;#39; class=&#38;#39;ginput_left&#38;#39;&#38;gt;
                &#38;lt;input type=&#38;#39;text&#38;#39; name=&#38;#39;input_5.3&#38;#39; id=&#38;#39;input_1_5.3&#38;#39; value=&#38;#39;&#38;#39; tabindex=&#38;#39;3&#38;#39; /&#38;gt;
                &#38;lt;label for=&#38;#39;input_1_5.3&#38;#39;&#38;gt;First&#38;lt;/label&#38;gt;
            &#38;lt;/span&#38;gt;
            &#38;lt;span id=&#38;#39;input_1_5_6_container&#38;#39; class=&#38;#39;ginput_right&#38;#39;&#38;gt;
                &#38;lt;input type=&#38;#39;text&#38;#39; name=&#38;#39;input_5.6&#38;#39; id=&#38;#39;input_1_5.6&#38;#39; value=&#38;#39;&#38;#39; tabindex=&#38;#39;4&#38;#39; /&#38;gt;
                &#38;lt;label for=&#38;#39;input_1_5.6&#38;#39;&#38;gt;Last&#38;lt;/label&#38;gt;
            &#38;lt;/span&#38;gt;
    	&#38;lt;/div&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;for the name should it be $entry[&#34;input_1_5.3&#34;] or $entry[&#34;input_5.3&#34;]?&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;li id=&#38;#39;field_1_11&#38;#39; class=&#38;#39;gfield&#38;#39; &#38;gt;
    	&#38;lt;label class=&#38;#39;gfield_label&#38;#39; for=&#38;#39;input_1_11&#38;#39;&#38;gt;Would you like to subscribe to our free email newsletter?&#38;lt;/label&#38;gt;
        &#38;lt;div class=&#38;#39;ginput_container&#38;#39;&#38;gt;
        	&#38;lt;select name=&#38;#39;input_11&#38;#39; id=&#38;#39;input_1_11&#38;#39;  class=&#38;#39;medium gfield_select&#38;#39; tabindex=&#38;#39;8&#38;#39; &#38;gt;
            	&#38;lt;option value=&#38;#39;Yes&#38;#39; selected=&#38;#39;selected&#38;#39;&#38;gt;Yes&#38;lt;/option&#38;gt;
                &#38;lt;option value=&#38;#39;No&#38;#39; &#38;gt;No&#38;lt;/option&#38;gt;
            &#38;lt;/select&#38;gt;
        &#38;lt;/div&#38;gt;
    &#38;lt;/li&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;and again, is it $entry[&#34;input_1_11&#34;] or $entry[&#34;input_11&#34;]?&#60;/p&#62;
&#60;p&#62;and the newsletter question is not a checkbox, so should i go&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;if ($entry[&#38;quot;input_1_11&#38;quot;] == &#38;#39;Yes&#38;#39;) {
... do something ...
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Many thanks.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Alex Cancado on "adding action"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/adding-action#post-5232</link>
			<pubDate>Tue, 04 May 2010 09:24:16 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">5232@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Try the following code snippet. (Replacing the ID's with yours). Place it in your theme's function.php file.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;quot;gform_post_submission&#38;quot;, &#38;quot;send_to_aweber&#38;quot;, 10, 2);
function send_to_aweber($entry, $form){

    //Ignore submissions from forms other than form 2
    if($form[&#38;quot;id&#38;quot;] != 2)
        return;

    //If received Newsletter is checked
    //Assuming your checkbox id is (2.1).
    //Replace it with your actual id. You can find it by inspecting the HTML source
    if(!empty($entry[&#38;quot;2.1&#38;quot;])){

        //Replace 1 (in $entry[1]) with your actual name field id
        //Replace 2 (in $entry[2]) with your actual email field id
        $msg_body = &#38;quot;HLE Subscription\n&#38;quot;.
                        &#38;#39;Name: &#38;#39;.$entry[&#38;quot;1&#38;quot;].&#38;quot;\n&#38;quot;.
                        &#38;#39;Email: &#38;#39;.$entry[&#38;quot;2&#38;quot;].&#38;quot;\n&#38;quot;;

        @mail(&#38;#39;hle@aweber.com&#38;#39;, &#38;#39;HLE Subscription&#38;#39;, $msg_body, &#38;#39;From: &#60;a href=&#34;mailto:admin@homeloanexperts.com.au&#34;&#62;admin@homeloanexperts.com.au&#60;/a&#62;&#38;#39;);
    }
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>jochan on "adding action"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/adding-action#post-5227</link>
			<pubDate>Tue, 04 May 2010 04:16:25 +0000</pubDate>
			<dc:creator>jochan</dc:creator>
			<guid isPermaLink="false">5227@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I have no experience with hooks and action... and need some direction.&#60;/p&#62;
&#60;p&#62;So here is what I need..&#60;br /&#62;
One of my question in my form is to ask if the client want to subscribe to our newsletter, if they do, we'll send an email to aweber to subscribe the client&#60;/p&#62;
&#60;p&#62;I've been using cform up until today... this is the code that I used in cforms&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;if ( $formID == &#38;#39;2&#38;#39; ) {

		if ($form[&#38;#39;Receive Newsletter?&#38;#39;] == &#38;#39;Yes&#38;#39;) {

			$msg_body = &#38;quot;HLE Subscription\n&#38;quot;.
						&#38;#39;Name: &#38;#39;.$form[&#38;#39;First Name*&#38;#39;].&#38;quot;\n&#38;quot;.
						&#38;#39;Email: &#38;#39;.$form[&#38;#39;Email*&#38;#39;].&#38;quot;\n&#38;quot;;

			@mail(&#38;#39;hle@aweber.com&#38;#39;, &#38;#39;HLE Subscription&#38;#39;, $msg_body, &#38;#39;From: &#60;a href=&#34;mailto:admin@homeloanexperts.com.au&#34;&#62;admin@homeloanexperts.com.au&#60;/a&#62;&#38;#39;);

		}
	}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;however i'm not sure how to do it when i need to use add_action.. a few questions here&#60;/p&#62;
&#60;p&#62;should i use 'gform_pre_submission' or 'gform_post_submission'?&#60;/p&#62;
&#60;p&#62;how do I refer to the form in the function?&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;function subscribe($form) {
...
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;is this correct?&#60;/p&#62;
&#60;p&#62;do i place the function in functions.php in my theme folder?&#60;/p&#62;
&#60;p&#62;and when in the function&#60;br /&#62;
do I refer the first name as $form[input_5.3]?&#60;br /&#62;
the 'dot' just seems a bit weird to me.&#60;/p&#62;
&#60;p&#62;thank you for your help
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
