Hi,
I am creating a "Tell a friend" type form, and in the form the user can optionally specify the subject of the email.
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.
Following from the info I found in this forum post: http://forum.gravityhelp.com/topic/in-replace_variables-what-is I came up with the code below however it doesn't work.
Added to functions.php:
add_filter("gform_pre_submission_filter", "editfields");
function editfields($form){
// only action on the sendtofriend form id=1
if($form["id"] != 1) {
return;
}
// Set the subject line to the users if they entered one, else set to default
if (trim($_POST["input_10"]) != "") {
$subject = trim($_POST["input_10"]);
} else {
$subject = 'hopkinsrealty.com.au - property from a friend';
}
$form["notification"]["subject"] = $subject;
return $form;
}
Thanks any help would be appreciated!