Page 1 of 1
FormTitle as default Subject in contact form and mail?
Posted: Mon 8. Sep 2008, 15:36
by egerlach
I found in archive of year 2003 the same question I ask for now:
http://forum.phpwcms.org/viewtopic.php? ... ect#p43201
How can I set the subject of contact form / subject of mail depending on where the visitor was before? - Perhaps now in 2008 a solution available?
I call the contact form by using "content part" and call content-ID 63. Is it perhaps possible to call a content part with a parameter? Or with some text?
thx
Eckard
Re: FormTitle as default Subject in contact form and mail?
Posted: Mon 8. Sep 2008, 16:41
by Oliver Georgi
Yes it is possible. Form can get custom field which sets subject. If you set this as hidden you can also define a default value which can be an internal value or what ever you like using frontend_render.
Oliver
Re: FormTitle as default Subject in contact form and mail?
Posted: Mon 8. Sep 2008, 21:37
by egerlach
sorry, don't understand anything. I've searched frontend_render in this forum archive and I indeed find something, but I don't understand. Can you give me some pointers that I know which direction to search and to work?
German:
Ich verstehe leider NICHTS. Habe mal nach frontend_render gesucht und finde das was, was ich auch nicht weiter verstehe. Hast Du mir vielleicht ein paar Stichworte in welche Richtung ich mich einlesen soll bzw wonach ich hier im Forum-Archiv suchen soll?
Eckard
Re: FormTitle as default Subject in contact form and mail?
Posted: Mon 8. Sep 2008, 22:04
by Oliver Georgi
Here are some hints:

- 2008-09-08_215346.gif (5.67 KiB) Viewed 1147 times
Then create a new script in
template/inc_script/frontend_render - maybe name it
mycustomsubject.php:
Code: Select all
<php
$content['all'] = str_replace('{CUSTOM_SUBJECT}', 'Whatever The Custom Subject Is', $content['all']);
?>
The string 'Whatever The Custom Subject Is' can be whatever you need - also the result of another function.
Oliver