<?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: replace_variables() question</title>
		<link>https://legacy.forums.gravityhelp.com/topic/in-replace_variables-what-is</link>
		<description>Gravity Support Forums Topic: replace_variables() question</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 08:25:55 +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/in-replace_variables-what-is" rel="self" type="application/rss+xml" />

		<item>
			<title>Steph on "replace_variables() question"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/in-replace_variables-what-is#post-3808</link>
			<pubDate>Mon, 08 Mar 2010 12:04:05 +0000</pubDate>
			<dc:creator>Steph</dc:creator>
			<guid isPermaLink="false">3808@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Carl,&#60;/p&#62;
&#60;p&#62;I'm using this code....&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;quot;gform_pre_submission_filter&#38;quot;, &#38;quot;add_bcc&#38;quot;);
function add_bcc($form){
    //change 2 to your actual form id
    if($form[&#38;quot;id&#38;quot;] != 10)
return;
    //Change the following input ids to match your fields.
    $bcc  = $_POST[&#38;quot;input_5&#38;quot;] . &#38;quot;,&#38;quot;; //friend 1 email
    $bcc .= $_POST[&#38;quot;input_6&#38;quot;] . &#38;quot;,&#38;quot;; //friend 2 email
    $bcc .= $_POST[&#38;quot;input_7&#38;quot;] . &#38;quot;,&#38;quot;; //friend 3 email
    $bcc .= $_POST[&#38;quot;input_8&#38;quot;] . &#38;quot;,&#38;quot;; //friend 4 email
    $bcc .= $_POST[&#38;quot;input_9&#38;quot;]; //friend 5 email

    $form[&#38;quot;notification&#38;quot;][&#38;quot;bcc&#38;quot;] = $bcc;
    return $form;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Steph
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carl Hancock on "replace_variables() question"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/in-replace_variables-what-is#post-3802</link>
			<pubDate>Mon, 08 Mar 2010 11:45:43 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">3802@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Steph, you would have to post the code you are trying to use here so we can take a look at it.  When putting code in your forum post, be sure to surround the code block between backtick ( ` ) characters so it will format it as code.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Steph on "replace_variables() question"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/in-replace_variables-what-is#post-3785</link>
			<pubDate>Sun, 07 Mar 2010 10:01:25 +0000</pubDate>
			<dc:creator>Steph</dc:creator>
			<guid isPermaLink="false">3785@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hello,&#60;/p&#62;
&#60;p&#62;This is just what I've been looking for - I've been trying to get this to work and I cant seem to!  Any chance of some help? :)&#60;/p&#62;
&#60;p&#62;I've pasted the above code into my functions.php file (at the bottom - if that makes any difference), I've changed the form id, and I've changed those input id's too.  However, when I submit the form it just sends the message to the first person in the list.&#60;/p&#62;
&#60;p&#62;My notifications are set to go to users and the to email field is set to be sent to the person that's submitting the form.&#60;/p&#62;
&#60;p&#62;What else could I be doing wrong? &#60;/p&#62;
&#60;p&#62;Thanks,&#60;br /&#62;
Steph
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Alex Cancado on "replace_variables() question"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/in-replace_variables-what-is#post-3589</link>
			<pubDate>Wed, 24 Feb 2010 10:48:47 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">3589@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Try the following code snippet. NOTE: You will need to change the input ids and the form id to match your values.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;quot;gform_pre_submission_filter&#38;quot;, &#38;quot;add_bcc&#38;quot;);
function add_bcc($form){
    //change 2 to your actual form id
    if($form[&#38;quot;id&#38;quot;] != 2)
        return;

    //Change the following input ids to match your fields.
    $bcc  = $_POST[&#38;quot;input_9&#38;quot;] . &#38;quot;,&#38;quot;; //friend 1 email
    $bcc .= $_POST[&#38;quot;input_11&#38;quot;] . &#38;quot;,&#38;quot;; //friend 2 email
    $bcc .= $_POST[&#38;quot;input_13&#38;quot;] . &#38;quot;,&#38;quot;; //friend 3 email
    $bcc .= $_POST[&#38;quot;input_15&#38;quot;] . &#38;quot;,&#38;quot;; //friend 4 email
    $bcc .= $_POST[&#38;quot;input_17&#38;quot;]; //friend 5 email

    $form[&#38;quot;notification&#38;quot;][&#38;quot;bcc&#38;quot;] = $bcc;
    return $form;
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>Alex Cancado on "replace_variables() question"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/in-replace_variables-what-is#post-3579</link>
			<pubDate>Tue, 23 Feb 2010 22:26:54 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">3579@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;What you need to do is use the pre_submission hook and programatically add the emails to the form's BCC field. I will send you a code snippet to get you started soon.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>taprootcreative on "replace_variables() question"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/in-replace_variables-what-is#post-3566</link>
			<pubDate>Tue, 23 Feb 2010 11:57:51 +0000</pubDate>
			<dc:creator>taprootcreative</dc:creator>
			<guid isPermaLink="false">3566@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Sure, what we are looking to do is create a &#34;Tell A Friend&#34; form which allows you to email a page to x amount of people at a time. So your basic form may look like:&#60;/p&#62;
&#60;p&#62;Your Name&#60;br /&#62;
Your Email&#60;br /&#62;
Friend 1 Email&#60;br /&#62;
Friend 2 Email&#60;br /&#62;
Friend 3 Email&#60;br /&#62;
Friend 4 Email&#60;br /&#62;
Friend 5 Email&#60;/p&#62;
&#60;p&#62;When you submit the form it'll kick out an &#34;invitation&#34; email to Friends 1 - 5. The problem currently is that in the Notifications, the Bcc field doesn't allow for the gravity form custom tags {foo}.&#60;/p&#62;
&#60;p&#62;Currently I have my function hooked into gform_post_submission, and it loops through the results. I'm able to isolate the friend email addresses, however, I still want to use certain aspects of GForms so the client can maintain the form easily. Such as the Message field in the Notification to User area. And I can isolate that output as well but I'm not able to convert the GForms tags.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Alex Cancado on "replace_variables() question"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/in-replace_variables-what-is#post-3536</link>
			<pubDate>Mon, 22 Feb 2010 12:20:23 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">3536@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;If all you want to do is send the notification to more than one person, I think there is an easier way to do this with existing hooks.&#60;br /&#62;
Can you explain what exactly you are trying to accomplish? I can come up with a code snippet to get the job done.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>taprootcreative on "replace_variables() question"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/in-replace_variables-what-is#post-3535</link>
			<pubDate>Mon, 22 Feb 2010 12:10:38 +0000</pubDate>
			<dc:creator>taprootcreative</dc:creator>
			<guid isPermaLink="false">3535@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;In the common.php, in the method replace_variables() what is $lead supposed to be? I'm trying to create a hook that will allow me to create a &#34;tell a friend&#34; to email more than one person at a time and it's almost there, I just need to be able to get the user notification message to parse the variables such as {all_fields} and what not. Or is there another way to go about it?
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
