<?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 Subject for Notifications</title>
		<link>https://legacy.forums.gravityhelp.com/topic/custom-subject-for-notifications</link>
		<description>Gravity Support Forums Topic: Custom Subject for Notifications</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 10:08:21 +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-subject-for-notifications" rel="self" type="application/rss+xml" />

		<item>
			<title>Carl Hancock on "Custom Subject for Notifications"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/custom-subject-for-notifications#post-6417</link>
			<pubDate>Thu, 17 Jun 2010 09:20:28 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">6417@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;An easier way to accomplish this would be to use a default value on the field you use for the subject.  So pre-populate the subject field and if they want to edit it to change it, they can edit it and change it.  This would require no code changes to accomplish.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Christine on "Custom Subject for Notifications"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/custom-subject-for-notifications#post-6410</link>
			<pubDate>Thu, 17 Jun 2010 03:23:17 +0000</pubDate>
			<dc:creator>Christine</dc:creator>
			<guid isPermaLink="false">6410@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;I am creating a &#34;Tell a friend&#34; type form, and in the form the user can optionally specify the subject of the email.&#60;/p&#62;
&#60;p&#62;When I come to send the notification out, what I would like to do, is use that subject if it is not empty otherwise use a default subject line.&#60;/p&#62;
&#60;p&#62;Following from the info I found in this forum post:  &#60;a href=&#34;http://forum.gravityhelp.com/topic/in-replace_variables-what-is&#34; rel=&#34;nofollow&#34;&#62;http://forum.gravityhelp.com/topic/in-replace_variables-what-is&#60;/a&#62;  I came up with the code below however it doesn't work.&#60;/p&#62;
&#60;p&#62;Added to functions.php:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;quot;gform_pre_submission_filter&#38;quot;, &#38;quot;editfields&#38;quot;);

function editfields($form){
    // only action on the sendtofriend form id=1
    if($form[&#38;quot;id&#38;quot;] != 1) {
        return;
	}

	// Set the subject line to the users if they entered one, else set to default
	if (trim($_POST[&#38;quot;input_10&#38;quot;]) != &#38;quot;&#38;quot;) {
		$subject = trim($_POST[&#38;quot;input_10&#38;quot;]);
	} else {
		$subject = &#38;#39;hopkinsrealty.com.au - property from a friend&#38;#39;;
	}

    $form[&#38;quot;notification&#38;quot;][&#38;quot;subject&#38;quot;] = $subject;
    return $form;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Thanks any help would be appreciated!
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
