<?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>Appnitro Software Forums Topic: Email from a drop downlist</title>
<link>http://www.appnitro.com/forums/</link>
<description>Appnitro Software Forums Topic: Email from a drop downlist</description>
<language>en</language>
<pubDate>Wed, 07 Jan 2009 02:23:23 +0000</pubDate>

<item>
<title>franki on "Email from a drop downlist"</title>
<link>http://www.appnitro.com/forums/topic/email-from-a-drop-downlist#post-3571</link>
<pubDate>Thu, 06 Nov 2008 23:46:04 +0000</pubDate>
<dc:creator>franki</dc:creator>
<guid isPermaLink="false">3571@http://www.appnitro.com/forums/</guid>
<description>&#60;p&#62;Yeah, is it just me?? Sometimes I'm just lucky I guess :)&#60;/p&#62;
&#60;p&#62;Hey thank you for the tip! That was driving me crazy.
&#60;/p&#62;</description>
</item>
<item>
<title>redityo on "Email from a drop downlist"</title>
<link>http://www.appnitro.com/forums/topic/email-from-a-drop-downlist#post-3569</link>
<pubDate>Thu, 06 Nov 2008 19:01:03 +0000</pubDate>
<dc:creator>redityo</dc:creator>
<guid isPermaLink="false">3569@http://www.appnitro.com/forums/</guid>
<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;Hmmm really it send with review page disabled? I will check it. However you can try comment the code on line 478. It will not send to &#34;notification&#34; email, only to the email list from selected options.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;//$send_status = $mail-&#38;gt;Send(); &#38;lt;-- comment this
$mail-&#38;gt;ClearAddresses();&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>franki on "Email from a drop downlist"</title>
<link>http://www.appnitro.com/forums/topic/email-from-a-drop-downlist#post-3559</link>
<pubDate>Thu, 06 Nov 2008 10:19:10 +0000</pubDate>
<dc:creator>franki</dc:creator>
<guid isPermaLink="false">3559@http://www.appnitro.com/forums/</guid>
<description>&#60;p&#62;Is it strange that I tried this process and mine sends email even if I don't have preview enabled??&#60;br /&#62;
However, in both cases it will not send email to the address selected from the menu unless I have an email address fill out in the notification setting. When I do have an address in the notification the form sends to that one and to the selected address from the form.&#60;br /&#62;
How can I eliminate the notification email and only get one from the form option that was selected?&#60;/p&#62;
&#60;p&#62;Thanks again.
&#60;/p&#62;</description>
</item>
<item>
<title>anthonybest on "Email from a drop downlist"</title>
<link>http://www.appnitro.com/forums/topic/email-from-a-drop-downlist#post-2680</link>
<pubDate>Fri, 15 Aug 2008 00:14:18 +0000</pubDate>
<dc:creator>anthonybest</dc:creator>
<guid isPermaLink="false">2680@http://www.appnitro.com/forums/</guid>
<description>&#60;p&#62;Please ingore above message.  I made changes to my SMTP settings and this is now working perfectly..
&#60;/p&#62;</description>
</item>
<item>
<title>anthonybest on "Email from a drop downlist"</title>
<link>http://www.appnitro.com/forums/topic/email-from-a-drop-downlist#post-2679</link>
<pubDate>Thu, 14 Aug 2008 22:38:13 +0000</pubDate>
<dc:creator>anthonybest</dc:creator>
<guid isPermaLink="false">2679@http://www.appnitro.com/forums/</guid>
<description>&#60;p&#62;I have entered the above text.  The form returns no error, and saves the data in the form.  However the mail does not send.  My mail server requires authentication.  I have another for where mail is working correctly.&#60;/p&#62;
&#60;p&#62;Is there a change that should be made to add in the authentication information?
&#60;/p&#62;</description>
</item>
<item>
<title>yuniar on "Email from a drop downlist"</title>
<link>http://www.appnitro.com/forums/topic/email-from-a-drop-downlist#post-2601</link>
<pubDate>Thu, 07 Aug 2008 14:30:17 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">2601@http://www.appnitro.com/forums/</guid>
<description>&#60;p&#62;Ok, let's take an example with this form:&#60;br /&#62;
&#60;a href=&#34;http://www.appnitro.com/forms/view.php?id=18&#34; rel=&#34;nofollow&#34;&#62;http://www.appnitro.com/forms/view.php?id=18&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;That form is having form_id = 18 and the &#34;Send Email To&#34; dropdown is having id = &#34;element_3&#34; (view the HTML source to see this)&#60;/p&#62;
&#60;p&#62;The dropdown is having some values:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;option value=&#38;quot;1&#38;quot; &#38;gt;Sales&#38;lt;/option&#38;gt;
&#38;lt;option value=&#38;quot;2&#38;quot; &#38;gt;Human Resource Dept.&#38;lt;/option&#38;gt;
&#38;lt;option value=&#38;quot;3&#38;quot; &#38;gt;Support&#38;lt;/option&#38;gt;
&#38;lt;option value=&#38;quot;4&#38;quot; &#38;gt;Accounting&#38;lt;/option&#38;gt;
&#38;lt;option value=&#38;quot;5&#38;quot; &#38;gt;Legal&#38;lt;/option&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;To be able sending email to the selected user from the dropdown, follow these steps:&#60;/p&#62;
&#60;p&#62;1) Edit &#60;strong&#62;hooks/custom_hooks.php&#60;/strong&#62;, add this 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;Adjust the function name &#60;strong&#62;form18_hook_email&#60;/strong&#62; to use your own form id number. Also adjust the &#60;strong&#62;element_3&#60;/strong&#62; with your own dropdown id number.&#60;/p&#62;
&#60;p&#62;Of course, don't forget the email list too.&#60;/p&#62;
&#60;p&#62;2) Edit &#60;strong&#62;includes/helper-functions.php&#60;/strong&#62;, search around line 478 for this code:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;$send_status = $mail-&#38;gt;Send();
$mail-&#38;gt;ClearAddresses();&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Right under that code, insert this code:&#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;3) Edit &#60;strong&#62;confirm.php&#60;/strong&#62; and confirm_embed.php&#60;/strong&#62;. Around line 20, insert this line:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;require(&#38;#39;hooks/custom_hooks.php&#38;#39;);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;That would allow you to send email to the selected user from dropdown.&#60;br /&#62;
The code above only work for form with &#34;Form Review&#34; enabled.
&#60;/p&#62;</description>
</item>
<item>
<title>anthonybest on "Email from a drop downlist"</title>
<link>http://www.appnitro.com/forums/topic/email-from-a-drop-downlist#post-2584</link>
<pubDate>Mon, 04 Aug 2008 23:45:38 +0000</pubDate>
<dc:creator>anthonybest</dc:creator>
<guid isPermaLink="false">2584@http://www.appnitro.com/forums/</guid>
<description>&#60;p&#62;Yes, on this specific for I do have it enabled.  If the only way to make it work is to disable this, I believe I can turn it off.
&#60;/p&#62;</description>
</item>
<item>
<title>yuniar on "Email from a drop downlist"</title>
<link>http://www.appnitro.com/forums/topic/email-from-a-drop-downlist#post-2566</link>
<pubDate>Fri, 01 Aug 2008 10:59:01 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">2566@http://www.appnitro.com/forums/</guid>
<description>&#60;p&#62;Do you have form review enabled or not?&#60;/p&#62;
&#60;p&#62;I have some hack for this, but would depend on your answer to the above question.
&#60;/p&#62;</description>
</item>
<item>
<title>anthonybest on "Email from a drop downlist"</title>
<link>http://www.appnitro.com/forums/topic/email-from-a-drop-downlist#post-2559</link>
<pubDate>Thu, 31 Jul 2008 23:27:44 +0000</pubDate>
<dc:creator>anthonybest</dc:creator>
<guid isPermaLink="false">2559@http://www.appnitro.com/forums/</guid>
<description>&#60;p&#62;Is it possible to have the user select who the form is emailed to from a drop down list?
&#60;/p&#62;</description>
</item>

</channel>
</rss>
