Custom subject line

shank 06 Dec, 2007
Hello all

I'm trying to customize my EMAIL subject with some of the input fields from the form. I am not placing the data in a DB, but just taking the form and having it emailed. I was able to have the email content have the form content, but now I need the email subject to have a field (users name) in the subject.

thanks!
GreyHead 07 Dec, 2007
Hi shank,

Put the field name in the 'Subject field' box on the 'Special Fields' tab.

Bob
shank 07 Dec, 2007
Hello again

The one field works, sweet.

but the question is how do I so for example


subject line: Hello firstname_field lastname_field how are you?

basically multiple fields and a statement
GreyHead 07 Dec, 2007
Hi shank,

It needs a little code snippet in the 'OnSubmit before email' box:
<?php
$rows[0]->emailsubject = "Hello ".$_POST['firstname_field']." "$_POST['laststname_field']," how are you?";
?>
Bob
shank 07 Dec, 2007
do i need special fields too? or just this code snippet?

regards..
shank 07 Dec, 2007
i put the code in exactly how you had it, but i still get the subject TEST which i put in the general tab...
GreyHead 07 Dec, 2007
Hi shank,

I'm having a bad hair day - there's a typo in there too. Try this version:
<?php
$rows[0]->emailsubject = "Hello ".$_POST['firstname_field']." "$_POST['laststname_field']." how are you?";
?>
Bob
shank 07 Dec, 2007
i tried that put TEST comes as the subject line, which is in the general tab.
GreyHead 08 Dec, 2007
Hi shank,

*** **** ***** *** !! * another typo . . .
 <?php
$rows[0]->emailsubject = "Hello ".$_POST['firstname_field']." ".$_POST['laststname_field']." how are you?";
?>
Bob
This topic is locked and no more replies can be posted.