NAVIGATION
An example for using a automatic subject in form.
Posted by markus_s
Forum: http://forum.phpwcms.org/viewtopic.php?p=92977#p92977
Using this tools you can write a hidden form field into the “subject” of the e-mail …
To use a hidden field please have a look …
Ok - if you want the name of the artikel in the mail subject to identify your contact forms, you need a new .php file in your frontend render.
The problem:
In several “articles” I uses a form for contact. (Course registration)
I need the info to this course without a specially registration,
after a customer has registered himself by the contact form to this course.
Let´s go:
1. Make in your contact form a hidden field with the name mailsubject.
Type in the field “Value”:
[%GLOBAL_FORM_SUBJECT%]
and save this.
2. Choose in the top ob the form under “subject” the “Form: mailsubject”
3. Make a file at your editor with the following content:
<?php $content['all'] = str_replace('[%GLOBAL_FORM_SUBJECT%]', trim('your own text: ' . html_specialchars($content['article_title'])), $content['all']); ?>
Save the file with the name “email_subject.php” under template/inc_script/frontend_render or simply download the finished file HERE (email_subject.zip (364 B, 121 downloads))
4. Now the article title is seen in the subject from your email - now, you can ident the different contact forms …
Have a look too: Send a friend