FormTitle as default Subject in contact form and mail?

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
egerlach
Posts: 74
Joined: Thu 25. Aug 2005, 21:29
Location: Karlsruhe (Germany)

FormTitle as default Subject in contact form and mail?

Post 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
User avatar
Oliver Georgi
Site Admin
Posts: 9918
Joined: Fri 3. Oct 2003, 22:22
Contact:

Re: FormTitle as default Subject in contact form and mail?

Post 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
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
egerlach
Posts: 74
Joined: Thu 25. Aug 2005, 21:29
Location: Karlsruhe (Germany)

Re: FormTitle as default Subject in contact form and mail?

Post 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
Last edited by egerlach on Tue 9. Sep 2008, 00:17, edited 1 time in total.
User avatar
Oliver Georgi
Site Admin
Posts: 9918
Joined: Fri 3. Oct 2003, 22:22
Contact:

Re: FormTitle as default Subject in contact form and mail?

Post by Oliver Georgi »

Here are some hints:
2008-09-08_215301.gif
2008-09-08_215346.gif
2008-09-08_215346.gif (5.67 KiB) Viewed 1145 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
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
Post Reply