add a contact form in catalog reader
Hello there !
i'm trying to add a simple contact form into a page generated by catalog, in the same page as the reader actually.
so you will have the description and photos of a company and after on the same page, a contact form to contact this company.
i thought that modifying catalog_notify would be a good idea, actually i think i only have to change the recipient in the code but my lack of knowledge in php is a problem.
I tried many things :
- in the configuration of the module i tried to write {{catalog::mail}} as the recipient but it doesn't work
- in the modulecatalognotify.php i tried to rewrite the code and replace
Code:
$objEmail->sendTo($recipient);
by
Code:
$objEmail->sendTo({{catalog::mail}} );
or
Code:
$objEmail->sendTo( ##mail##);
or add this :
Code:
$objEmail->sendTo = $this->replaceCatalogTags($this->catalog_recipients, $arrCatalog);
to add {{catalog::mail}} in the backend.
i know i'm trying write impossible syntax things but i think something like that would maybe work...
If it makes sense for someone please let me know, i would be really happy :D
Thx !
Re: add a contact form in catalog reader
Hello all,
i'm still looking for a solution, i think it's not really hard, i only have a syntax problem i think...
thank you if you know what i can do !
Re: add a contact form in catalog reader
I haven't used Catalog, but can't you just give a new value to recipient?
$recipient = '{{catalog::mail}}';
or try
$objEmail->sendTo('{{catalog::mail}}');
or
$myrecipient = '{{catalog::mail}}';
$objEmail->sendTo($myrecipient);
as the insert tag may need to be inside quotes.
All just guessing sorry.
Re: add a contact form in catalog reader
Hello, thank you for your answer, it really helps me.
But unfortunately it does'nt work, the page doesn't catch the value :
with the two first solutions i have the error :
Quote:
Fatal error: Uncaught exception Swift_RfcComplianceException with message Address in mailbox given [{{catalog::mail}}@] does not comply with RFC 2822, 3.6.2. thrown in E:\wamp\www\testportail\plugins\swiftmailer\classe s\Swift\Mime\Headers\MailboxHeader.php on line 309
and with the second :
Quote:
Fatal error: Uncaught exception Swift_RfcComplianceException with message Address in mailbox given [] does not comply with RFC 2822, 3.6.2. thrown in E:\wamp\www\testportail\plugins\swiftmailer\classe s\Swift\Mime\Headers\MailboxHeader.php on line 309
as it's an another module i think it's out the loop and doesn't understand what is {{catalog::mail}}.
writing <?php echo $entry['data']['mail]['value']; ?> will have the same result no ?
i will try to integrate to the catalog reader a homemade php form maybe
thanks !
Re: add a contact form in catalog reader
Ok, i tried to modify the catalog_reader and add a simple mail send and that starts like that :
Quote:
<?php
$mail = 'mail@mail.com';
....
by
Quote:
<?php
$mail = '<?php echo $entry['data']['mail']['value']; ?>';
....
and i've got a parse error...
the problem is that i don't understand what i'm writing, i sould really learn php :-/
edit : i tried
Quote:
$mail = $entry['data']['mail']['value'];
(woot ! what a reflexion !)
that seems better, i have a smtp error which is normal and also a parse error for the rest