Results 1 to 5 of 5

Thread: add a contact form in catalog reader

  1. #1
    New user
    Join Date
    11-05-10.
    Posts
    9

    Default 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 !

  2. #2
    New user
    Join Date
    11-05-10.
    Posts
    9

    Default 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 !

  3. #3
    Experienced user
    Join Date
    06-20-09.
    Posts
    1,311

    Default 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.

  4. #4
    New user
    Join Date
    11-05-10.
    Posts
    9

    Default 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 :

    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 :

    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 !

  5. #5
    New user
    Join Date
    11-05-10.
    Posts
    9

    Default 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 :

    <?php
    $mail = 'mail@mail.com';
    ....
    by
    <?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

    $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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •