<?xml version="1.0"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>MachForm Community Forums Topic: Send form results to specific email address based on selected radio button</title>
<link>https://www.machform.com/forums/</link>
<description>MachForm Community Forums Topic: Send form results to specific email address based on selected radio button</description>
<language>en</language>
<pubDate>Sat, 12 Sep 2026 19:45:41 +0000</pubDate>

<item>
<title>chuckgreen on "Send form results to specific email address based on selected radio button"</title>
<link>https://www.machform.com/forums/topic/send-form-results-to-specific-email-address-based-on-selected-radio-button#post-6081</link>
<pubDate>Thu, 04 Jun 2009 00:34:06 +0000</pubDate>
<dc:creator>chuckgreen</dc:creator>
<guid isPermaLink="false">6081@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Hi redityo,&#60;/p&#62;
&#60;p&#62;Thank you for the quick response and great code.  It works perfectly.  There are two more parts to this particular form that have come up and are what I would consider, minor details.  What I mean is that I could live without these fixes if necessary.  The form is already so feature rich it is sick.  The code above you provided HAS solutioned all the particular email addresses that I need to receive the form data.  The two emails that you set in the Admin area are not necessary to me.  In fact, let me ask the following two questions:&#60;/p&#62;
&#60;p&#62;1)  In the Admin Control Panel/Manage Forms/Form Name/Emails/Your Users....Is it possible to have the &#34;From Email address&#34; be set to one of the element_id list option emails shown above in the custom_hooks.php file that will be chosen by a user during form submission?  Is there a template variable that I can insert there based on your code above?&#60;/p&#62;
&#60;p&#62;2)  In the Admin Control Panel/Manage Forms/Form Name/Emails/Send notification emails to You.......does it disrupt the script to not fill in the &#34;Your Email Address&#34; so that it is blank and set that &#34;Notifications will be sent to: nobody&#34;.  For this particular form, there are no other email notifications necessary.&#60;/p&#62;
&#60;p&#62;I appreciate your help.&#60;/p&#62;
&#60;p&#62;Chuck
&#60;/p&#62;</description>
</item>
<item>
<title>redityo on "Send form results to specific email address based on selected radio button"</title>
<link>https://www.machform.com/forums/topic/send-form-results-to-specific-email-address-based-on-selected-radio-button#post-6068</link>
<pubDate>Wed, 03 Jun 2009 08:34:30 +0000</pubDate>
<dc:creator>redityo</dc:creator>
<guid isPermaLink="false">6068@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;It seems you need to change some code, in my previous code, you can see these code :&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;function form18_hook_email($params){

	//change the email addresses below
	$email_list[1] = &#38;#39;sales@example.com&#38;#39;;
	$email_list[2] = &#38;#39;hrd@example.com&#38;#39;;
	$email_list[3] = &#38;#39;support@example.com&#38;#39;;
	$email_list[4] = &#38;#39;accounts@example.com&#38;#39;;
	$email_list[5] = &#38;#39;legal@example.org&#38;#39;; 

	$res = do_query(&#38;quot;select element_3 from ap_form_{$params[&#38;#39;form_id&#38;#39;]}
where id=&#38;#39;{$params[&#38;#39;entry_id&#38;#39;]}&#38;#39;&#38;quot;);
	$row = do_fetch_result($res);

	$attn = $row[&#38;#39;element_3&#38;#39;];

	$target_email = $email_list[$attn];

	if(!empty($target_email)){
		return $target_email;
	}else {
		return true;
	}
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;replace it with&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;function form18_hook_email($params){

	//change the email addresses below
	//email address list for drop down 1
	$email_list1[1] = &#38;#39;sales@example.com&#38;#39;;
	$email_list1[2] = &#38;#39;hrd@example.com&#38;#39;;
	$email_list1[3] = &#38;#39;support@example.com&#38;#39;;
	$email_list1[4] = &#38;#39;accounts@example.com&#38;#39;;
	$email_list1[5] = &#38;#39;legal@example.org&#38;#39;; 

	//email address list for drop down 2
	$email_list2[1] = &#38;#39;one@example.com&#38;#39;;
	$email_list2[2] = &#38;#39;two@example.com&#38;#39;;
	$email_list2[3] = &#38;#39;three@example.com&#38;#39;;
	$email_list2[4] = &#38;#39;four@example.com&#38;#39;;
	$email_list2[5] = &#38;#39;five@example.org&#38;#39;; 

	$res = do_query(&#38;quot;select element_3,element_8 from ap_form_{$params[&#38;#39;form_id&#38;#39;]}
where id=&#38;#39;{$params[&#38;#39;entry_id&#38;#39;]}&#38;#39;&#38;quot;);
	$row = do_fetch_result($res);

	//get email for drop down 1
	$attn = $row[&#38;#39;element_3&#38;#39;];
	$target_email = $email_list1[$attn]  ;

	//get email for drop down 2
	$attn = $row[&#38;#39;element_8&#38;#39;];
	$target_email .= &#38;quot;,&#38;quot; . $email_list2[$attn];

	if(!empty($target_email)){
		return $target_email;
	}else {
		return true;
	}
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;After that, go to this code in &#34;helper-functions.php&#34;&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;if($target_is_admin){

	if(function_exists(&#38;quot;form{$form_id}_hook_email&#38;quot;)){

		$carbon_param[&#38;#39;form_id&#38;#39;] = $form_id;
		$carbon_param[&#38;#39;entry_id&#38;#39;] = $entry_id;
		$carbon_email = call_user_func(&#38;quot;form{$form_id}_hook_email&#38;quot;,$carbon_param);

		if(!empty($carbon_email)){
				$mail-&#38;gt;AddAddress($carbon_email);
				$mail-&#38;gt;Send();
			}
		}
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;then change it to&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;if($target_is_admin){

if(function_exists(&#38;quot;form{$form_id}_hook_email&#38;quot;)){

	$carbon_param[&#38;#39;form_id&#38;#39;] = $form_id;
	$carbon_param[&#38;#39;entry_id&#38;#39;] = $entry_id;
	$carbon_email = call_user_func(&#38;quot;form{$form_id}_hook_email&#38;quot;,$carbon_param);

	if(!empty($carbon_email)){
			$email_address 	= explode(&#38;#39;,&#38;#39;,$carbon_email);

			foreach ($email_address as $email){
				$email = trim($email);
				if(!empty($email)){
					$mail-&#38;gt;AddAddress($email);
					$has_email = true;

				}
			}
			$mail-&#38;gt;Send();
                        $mail-&#38;gt;ClearAddresses();
		}
	}
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;those code will send notification based on drop down (element_3) and drop_down (element_8) email list
&#60;/p&#62;</description>
</item>
<item>
<title>chuckgreen on "Send form results to specific email address based on selected radio button"</title>
<link>https://www.machform.com/forums/topic/send-form-results-to-specific-email-address-based-on-selected-radio-button#post-6057</link>
<pubDate>Tue, 02 Jun 2009 03:30:36 +0000</pubDate>
<dc:creator>chuckgreen</dc:creator>
<guid isPermaLink="false">6057@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;First, thanks redityo, the custom_hooks.php mod worked great.  But another question:  What would the code look like if I had two different &#34;drop downs&#34; on the same form that were to send emails to specific email addresses based on selections?  For instance...form1 has a dropdown (element_3) and a dropdown (element_8); I need both to send to different emails based on the different option values of the dropdowns.  I am crossing my fingers that this is easy for you.  Let me know.  Thanks.&#60;/p&#62;
&#60;p&#62;Chuck
&#60;/p&#62;</description>
</item>
<item>
<title>redityo on "Send form results to specific email address based on selected radio button"</title>
<link>https://www.machform.com/forums/topic/send-form-results-to-specific-email-address-based-on-selected-radio-button#post-5712</link>
<pubDate>Mon, 04 May 2009 10:48:07 +0000</pubDate>
<dc:creator>redityo</dc:creator>
<guid isPermaLink="false">5712@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Hi Chuck,&#60;/p&#62;
&#60;p&#62;You can refer to this post :&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://www.appnitro.com/forums/topic/email-from-a-drop-downlist?replies=9#post-2601&#34; rel=&#34;nofollow&#34;&#62;http://www.appnitro.com/forums/topic/email-from-a-drop-downlist?replies=9#post-2601&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;It will send &#34;specific&#34; mail based on &#34;drop down&#34; selection, but i can be use for &#34;option/radio&#34; input also. Just make sure to change the form ID and element ID with yours.
&#60;/p&#62;</description>
</item>
<item>
<title>chuckgreen on "Send form results to specific email address based on selected radio button"</title>
<link>https://www.machform.com/forums/topic/send-form-results-to-specific-email-address-based-on-selected-radio-button#post-5701</link>
<pubDate>Sat, 02 May 2009 15:53:30 +0000</pubDate>
<dc:creator>chuckgreen</dc:creator>
<guid isPermaLink="false">5701@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Hello,&#60;/p&#62;
&#60;p&#62;I need to be able to send form results to multiple and specific email addresses based on a selected radio button on my form.  Example:  If Radio Button A is selected, the results will go to a different email address than if Radio Button B is selected.&#60;/p&#62;
&#60;p&#62;I would appreciate the help.  FYI: Very nice app!&#60;/p&#62;
&#60;p&#62;Chuck
&#60;/p&#62;</description>
</item>

</channel>
</rss>
