Does dynamic subject field work?

standoutsites 29 May, 2009
I've attempted to include existing fields from the form in the dynamic subject both with the curvy brackets and without. And I'm getting blank subject lines in the emails. is there a certain trick to this? i saw posts with a php hack for onsubmit before. Tried it too and no luck either. I'm using RC5
GreyHead 29 May, 2009
Hi standoutsites,

Yes, it works. Just the field name, no quotes, no brackets.

Bob
leolll 09 Jun, 2009
Using "Dynamic Subject" I get a blank subject line. If I change it to a regular "Subject" I get a subject line. Change it back to "Dynamic Subject" and it's blank again.

I'm using:
Chronoform 3.1 RC5
PHP Version: 5.2.8
Web Server: Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i mod_autoindex_color PHP/5.2.8
Joomla! Version: Joomla! 1.5.11 Production/Stable [ Vea ] 03-June-2009 03:30 GMT
GreyHead 09 Jun, 2009
Hi leoll,

Dynamic Subject works OK here - what are you putting in the Dynamic Subject box?

Bob
GreyHead 09 Jun, 2009
Hi leoll,

It looks as though you have {name} in the Dynamic Subject Box - please use just the field name, no brackets, no quotes.

Bob
GreyHead 09 Jun, 2009
Hi Leoll,

That looks OK - except that the value isn't being passed through.

JRequest::getVar is the Joomla code to return a filtered value from the $_REQUEST array. The parameters are 'field name', 'default value', 'source' (post, get or cookie) and 'parameter_type' (string, integer, command, . . . )

Email->dsubject = 'Dyna Title' should be returning a valid field_name . . . but field names can't contain spaces so that's the problem here.

If you have a field called Dyna Title, please rename it to Dyna_Title, if not, please put a field name in the Dynamic Subject box.

Bob
leolll 11 Jun, 2009
Hmm, so a Dynamic Subject can't contain any static text. I was trying to create a subject like this: Lead: $persons_name

Since this isn't possible I'll stick with a static subject line.

Thanks for the help Bob.
GreyHead 11 Jun, 2009
Hi leolll,

You can constuct a compound value easily enough - add a hidden field with name='subject', put subject in the Dynamic Subject box and add code in the OnSubmit Before box
<?php
$subject = 'Lead '.JRequest::getString('persons_name', '', 'post');
JRequest::setVar('subject', $subject);
?>

Bob
This topic is locked and no more replies can be posted.