<?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: custom queries in notification message</title>
		<link>https://legacy.forums.gravityhelp.com/topic/custom-queries-in-notification-message</link>
		<description>Gravity Support Forums Topic: custom queries in notification message</description>
		<language>en-US</language>
		<pubDate>Sun, 19 Apr 2026 14:52:46 +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/custom-queries-in-notification-message" rel="self" type="application/rss+xml" />

		<item>
			<title>David Smith on "custom queries in notification message"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/custom-queries-in-notification-message#post-7697</link>
			<pubDate>Fri, 23 Jul 2010 09:00:06 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">7697@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hey Mex,&#60;/p&#62;
&#60;p&#62;You're probably going to want to use the &#60;strong&#62;gform_pre_submission_filter&#60;/strong&#62; filter. This filter runs after the entry has been validated, but before the entry is saved to the database.&#60;/p&#62;
&#60;p&#62;The form object is passed as an array to this function, but you can modify the entry values as well by adding/updating the $_POST array. This would be an ideal place to query your database for the voucher code and then (building on Carl's suggestion) add a value to the $_POST that corresponds with the id of the hidden field. When the form is saved (and emailed to the user) the field will be populated for you.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Mexx on "custom queries in notification message"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/custom-queries-in-notification-message#post-7640</link>
			<pubDate>Wed, 21 Jul 2010 15:22:04 +0000</pubDate>
			<dc:creator>Mexx</dc:creator>
			<guid isPermaLink="false">7640@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hey Carl,&#60;/p&#62;
&#60;p&#62;can I accomplish this with these hooks?&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://www.gravityhelp.com/documentation/hooks-and-filters/&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/hooks-and-filters/&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;thanks, Max
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Mexx on "custom queries in notification message"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/custom-queries-in-notification-message#post-7610</link>
			<pubDate>Tue, 20 Jul 2010 16:31:32 +0000</pubDate>
			<dc:creator>Mexx</dc:creator>
			<guid isPermaLink="false">7610@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Carl,&#60;/p&#62;
&#60;p&#62;thanks for that very quick respond. That sounds like a good solution.&#60;br /&#62;
I'm quite comfortable with PHP but not with API hooks.&#60;/p&#62;
&#60;p&#62;Its probably some PHP thats resides in the function.php of my theme I guess.&#60;br /&#62;
But I haven't developed a plugin yet and therefore haven't done any WP API stuff.&#60;br /&#62;
I guess I could read a bit through Codex and figure out how to add a hook.&#60;br /&#62;
But then, how do I address that Gravity input field from that hook?&#60;/p&#62;
&#60;p&#62;If you could provide me with some code, that would be nice.&#60;/p&#62;
&#60;p&#62;thanks, Max
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carl Hancock on "custom queries in notification message"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/custom-queries-in-notification-message#post-7599</link>
			<pubDate>Tue, 20 Jul 2010 13:26:56 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">7599@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;The Notification to User message body won't support a query or PHP code.  &#60;/p&#62;
&#60;p&#62;Probably the easiest way to accomplish this would be to use a hidden field in your form that would represent the voucher code.  Then use a PHP hook to populate that hidden field with the voucher code that you query from your custom table when the form is submitted.&#60;/p&#62;
&#60;p&#62;Then in your notification email you can just output the value of that hidden form field that would contain the voucher code.&#60;/p&#62;
&#60;p&#62;How comfortable are you with PHP and API hooks?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Mexx on "custom queries in notification message"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/custom-queries-in-notification-message#post-7596</link>
			<pubDate>Tue, 20 Jul 2010 12:56:46 +0000</pubDate>
			<dc:creator>Mexx</dc:creator>
			<guid isPermaLink="false">7596@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hey,&#60;/p&#62;
&#60;p&#62;I have a gravityform for my users to order voucher codes with. I store the voucher codes in a separate table of my wordpress DB. When a user submits the form, there should be an email immediately send to them with a code in it. I  could use another plugin for that or write an own solution, but then the form does not feel, look and behave the same way other forms on my website do. Also the form data does not get stores in Gravaty's statistic.&#60;/p&#62;
&#60;p&#62;I tried to put a SQL query in the message box of &#34;Notification to User&#34;. But this code is not executed and just printed out: &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php
     $sq = &#38;quot;SELECT code FROM vouchers WHERE used&#38;lt;&#38;gt;&#38;#39;yes&#38;#39; LIMIT 1&#38;quot;;
     $query = mysql_query($sq);
     $dsatz = mysql_fetch_assoc($query);
     echo $dsatz[&#38;#39;code&#38;#39;];
?&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;I tried to find and hack the place in the plugin files where this codes gets escaped. Couldn't find it.&#60;br /&#62;
Can you point me to that place and give me a hint how to archive that?&#60;/p&#62;
&#60;p&#62;thanks, Max
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
