<?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 email based on value selected in the combo box.</title>
<link>https://www.machform.com/forums/</link>
<description>MachForm Community Forums Topic: send email based on value selected in the combo box.</description>
<language>en</language>
<pubDate>Mon, 04 May 2026 05:50:03 +0000</pubDate>

<item>
<title>redityo on "send email based on value selected in the combo box."</title>
<link>https://www.machform.com/forums/topic/send-email-based-on-value-selected-in-the-combo-box#post-4256</link>
<pubDate>Tue, 13 Jan 2009 00:30:44 +0000</pubDate>
<dc:creator>redityo</dc:creator>
<guid isPermaLink="false">4256@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;I think you can add some conditional to &#34;custom hook&#34; code, you can change from the original code to be like this  : &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;function form18_hook_email($params){

	//change the email addresses below
	$email_list[2] = &#38;#39;hrd@example.com&#38;#39;;
	$email_list[4] = &#38;#39;accounts@example.com&#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;];

        if (array_key_exists($attn, $email_list))
	   $target_email = $email_list[$attn];
        else
           $target_email = &#38;#39;test@test.com&#38;#39;;

	if(!empty($target_email)){
		return $target_email;
	}else {
		return true;
	}
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;in that example you only have non-standard email for option value 2 and 4. And for another value it will send same email that is test[at]test.com.
&#60;/p&#62;</description>
</item>
<item>
<title>raj000 on "send email based on value selected in the combo box."</title>
<link>https://www.machform.com/forums/topic/send-email-based-on-value-selected-in-the-combo-box#post-4243</link>
<pubDate>Sat, 10 Jan 2009 17:23:13 +0000</pubDate>
<dc:creator>raj000</dc:creator>
<guid isPermaLink="false">4243@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;I have a list of products that we sell listed in a combo box field. There are approximately 30 values in the combo box and increasing. When an entry is submitted, a notification is sent to &#60;a href=&#34;mailto:sales@example.com.&#34;&#62;sales@example.com.&#60;/a&#62; For most of the products, the same email address would be notified. However, for a few of the products, maybe 2 or 3, the email notification will be sent to a different department.  &#60;/p&#62;
&#60;p&#62;I have been following another thread on this subject -:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://www.appnitro.com/forums/topic/email-from-a-drop-downlist?replies=10&#34; rel=&#34;nofollow&#34;&#62;http://www.appnitro.com/forums/topic/email-from-a-drop-downlist?replies=10&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;This does not really serve my purpose because in the above code i need to define the email notification address for each option in the combo. I want to use the default email settings for the form for most of the options. I only want to modify the code when the email to be notified is different from the standard email notification setting. &#60;/p&#62;
&#60;p&#62;Please help . Thanks
&#60;/p&#62;</description>
</item>

</channel>
</rss>
