Buy Now
Sign in

Dynamic Subject in v3

calman , October 02 2013
C
calman
ok, I read the FAQ on this, but I just can't seem to get it to work. My email is sent with no subject. Here is my setup, thanks in advance for your help.

Tab: Setup emails
Heading: Dynamic Subject
Value: dynsubject

Tab: Form Code
Heading: On Submit code - before sending email:
Value: <?php $form->data['dynsubject'] = "Contact Us Form Submitted from {$form->data['email']}"; ?>

'email' is a field name in the form.

Joomla 1.5.26
ChronoContact v3.2
GreyHead
Hi calman,

The FAQ is for CFv4 (as are pretty much all of them now) :-(

Try replacing this
<?php $form->data['dynsubject'] = "Contact Us Form Submitted from {$form->data['email']}"; ?>
with
<?php
$email = JRequest::getVar('email', '', 'post');
JRequest::setVar('dynsubject', 'Contact Us Form Submitted from '.$email);
?>

Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
C
calman
perfect, works like a charm.

Thanks Bob!