Forums

Appending text to dynamic subject .. how?

leisurepublishing 27 May, 2009
So I'd like to append some text to the front end of the subject to identify the website it's from for the recipient. So if the visitor submits the form with the subject "Change my address", I'd like to append the following - [BRC] to the dynamic subject so it would end up like--

[BRC] Change my address

Or if the subject was "Reserve a room" then it would end up like--

[BRC] Reserve a room

How would I accomplish that? I figure I need to change something in "Form Code" but not really sure what or where to start?
GreyHead 27 May, 2009
Hi leisurepublishing,

Assuming that your dynamic subject field name is 'subject', try this in OnSubmit Before
<?php
$subject = JRequest::getString('subject', '', 'post');
$subject = '[BEC] '.$subject;
JRequest::setVar('subject', $subject);
?>

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