Forums

Dynamic Subject in v3

calman 02 Oct, 2013
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 03 Oct, 2013
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
calman 03 Oct, 2013
perfect, works like a charm.

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