Automatic subject in e-mail form
Automatic subject in e-mail form
Hi!
I would like to set up an e-mail form with some reference to the article from which it was sent.
Imagine a store with different products all presented in their own articles.
I want the customers to be able to fill out a form with inquiries of the specific products.
Is it possible to put this form in the template and maybe with some {RT} to get the article reference or do I have to manually set up a form for every new procuct and hard code the article reference?
Any ideas
thanx
tester
I would like to set up an e-mail form with some reference to the article from which it was sent.
Imagine a store with different products all presented in their own articles.
I want the customers to be able to fill out a form with inquiries of the specific products.
Is it possible to put this form in the template and maybe with some {RT} to get the article reference or do I have to manually set up a form for every new procuct and hard code the article reference?
Any ideas
thanx
tester
Hi!
No ideas?
Well this is what I've figured out myself - please tell me if its wrong or even stupid to do so!
I'm not using keywords on this site so if I put the product name or reference ID in the keyword for the article I can set up a link like this in the template:
info.php is a php-script with an E-mail form set up to catch the variable "name" in the subject..
This way there is only need for one form for all the articles.
I would like to use the internal content part "form" of phpwcms but haven't been able to figure out how to make this form accept variables in the subject fild of an E-mail.
Any ideas?
tester
No ideas?
Well this is what I've figured out myself - please tell me if its wrong or even stupid to do so!
I'm not using keywords on this site so if I put the product name or reference ID in the keyword for the article I can set up a link like this in the template:
Code: Select all
<div id="infoicon">
<a href="info.php?name=[PHP]print $GLOBALS["content"]["all_keywords"];[/PHP]" target="_blank">Info</a>
</div>
This way there is only need for one form for all the articles.
I would like to use the internal content part "form" of phpwcms but haven't been able to figure out how to make this form accept variables in the subject fild of an E-mail.
Any ideas?
tester
- Oliver Georgi
- Site Admin
- Posts: 9906
- Joined: Fri 3. Oct 2003, 22:22
- Contact:
here is the solution
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.
german:
ich hatte das problem, dass ich mehrere "CP artikel" hatte in denen sich alle ein kontaktformular
befindet. (für kursanmeldung) nun brauche ich, nachdem sich ein kunde über das kontaktforumlar
angemeldet hat, die info zu diesem kurs ohne, dass dies der kunde extra eintragen muss. und so gehts
1.
make in your contact form a "hidden field" with name "mailsubject".
type in the field "Value":
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:
save file with the name "email_subject.php" under template/inc_script/frontend_render
or simply download the finished file HERE (email_subject.zip)
4.
now the article title is seen in the subject from your email - now, you can ident the different contact forms ...
much fun ...
(thx to O.G.)
to identify your contact forms you need a new .php file in your frontend render.
german:
ich hatte das problem, dass ich mehrere "CP artikel" hatte in denen sich alle ein kontaktformular
befindet. (für kursanmeldung) nun brauche ich, nachdem sich ein kunde über das kontaktforumlar
angemeldet hat, die info zu diesem kurs ohne, dass dies der kunde extra eintragen muss. und so gehts
1.
make in your contact form a "hidden field" with name "mailsubject".
type in the field "Value":
Code: Select all
[%GLOBAL_FORM_SUBJECT%]
2.
choose in the top ob the form under "subject" the "Form: mailsubject"
3.
make a file at your editor with the following content:
Code: Select all
<?php
$content['all'] = str_replace('[%GLOBAL_FORM_SUBJECT%]', trim('your own text: ' . html_specialchars($content['article_title'])), $content['all']);
?>
or simply download the finished file HERE (email_subject.zip)
4.
now the article title is seen in the subject from your email - now, you can ident the different contact forms ...
much fun ...
(thx to O.G.)
Thanx markus s!
Maybe I didn't make my point clear or maybe I don't understand your solution.
I'm setting up a site for a customer who will add a lot of articles describing different products. I don't want him(my customer) to set up a form for every product. I want to "call" a form from the template with some sort of identification of the current article.
Hope this will clarify my intentions
Best regards
tester
Maybe I didn't make my point clear or maybe I don't understand your solution.
I'm setting up a site for a customer who will add a lot of articles describing different products. I don't want him(my customer) to set up a form for every product. I want to "call" a form from the template with some sort of identification of the current article.
Hope this will clarify my intentions
Best regards
tester
- Oliver Georgi
- Site Admin
- Posts: 9906
- Joined: Fri 3. Oct 2003, 22:22
- Contact:
This is described also a thousand times inside the forum - working like "send a friend".
Use an article with content part based on your needs outside public access.
Then use {SHOW_CONTENT:CP,ID} (ID = ID of the content part form) inside of your template.
It's no "out of the box" solution - but as I said it is discussed somewhere here in the forum.
Oliver
Use an article with content part based on your needs outside public access.
Then use {SHOW_CONTENT:CP,ID} (ID = ID of the content part form) inside of your template.
It's no "out of the box" solution - but as I said it is discussed somewhere here in the forum.
Oliver
Re: Automatic subject in e-mail form
Hallo,
ich habe das entsprechend meinen Bedürfnissen angepasst:
Leider wird der article_subtitle-Tag (hier Zeile 2) nicht umgesetzt, d.h. das Formularfeld bleibt leer. Mit article_id z. b. geht jedoch ohne Probleme. Woran liegt das?
Danke, Jo
ich habe das entsprechend meinen Bedürfnissen angepasst:
Code: Select all
<?php
// Ersetze Hidden mailsubject - vpn Oliver Georgie/PHPWCMS am 19.08.2007
// iniziert für DVA - Markus SChartner
$content['all'] = str_replace('[%reise_ziel%]', trim('Buchungsanfrage für ' . html_specialchars($content['article_title'])), $content['all']);
$content['all'] = str_replace('[%reise_zeit%]', trim('am ' . html_specialchars($content['article_subtitle'])), $content['all']);
?>
Danke, Jo
Re: Automatic subject in e-mail form
Hi,
mach mal ein
Nach dem ersten Schock wirst du staunen .....
Die Variable ist nicht ausgeführt, jedoch die ID mit und alle Artikel der aktuellen Ebene mit vielen Parametern im Array unter anderem auch der SubTitle.
Somit erreichst du mit den Untertitel
Knut
mach mal ein
Code: Select all
dumpVar($content);
bzw.
dumpVar($content['articles']);
Die Variable
Code: Select all
$content['article_subtitle']
Code: Select all
$content['article_id']
Code: Select all
$content['articles']
Somit erreichst du mit
Code: Select all
$content['articles'][$content['article_id']]['article_subtitle']
Knut
Last edited by flip-flop on Sat 16. Oct 2010, 07:30, edited 1 time in total.
>> HowTo | DOCU | FAQ | TEMPLATES/DOCS << ( SITE )
Re: Automatic subject in e-mail form
Ok, wieder was gelernt. Danke Knut!