Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2010
    Location
    NY - Hudson Valley
    Posts
    30
    Plugin Contributions
    0

    Default make a form to go to a different email address

    Hi,

    I've copied the contact form in order to make an additional and different type of form. It's all working well BUT... I need the form to go to a different email address than the original contact form.

    Does anyone know how to hardcode for that? Currently the contact form goes to a drop down list (set in the Admin). Is there a way to delete the code from the new tpl_newform.php and just hard code an address or two?

    Here are the 2 page areas that I think need help:

    tpl_pagename_default.php

    v<?php
    // show dropdown if set
    if (CONTACT_US_LIST !=''){
    ?>
    <label class="inputLabel" for="send-to"><?php echo SEND_TO_TEXT; ?></label>
    <?php echo zen_draw_pull_down_menu('send_to', $send_to_array, 'id=\"send-to\"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>
    <br class="clearBoth" />
    <?php
    }
    ?>

    header.php (for the new page)

    // use contact us dropdown if defined
    if (CONTACT_US_LIST !=''){
    $send_to_array=explode("," ,CONTACT_US_LIST);
    preg_match('/\<[^>]+\>/', $send_to_array[$_POST['send_to']], $send_email_array);
    $send_to_email= eregi_replace (">", "", $send_email_array[0]);
    $send_to_email= eregi_replace ("<", "", $send_to_email);
    $send_to_name = preg_replace('/\<[^*]*/', '', $send_to_array[$_POST['send_to']]);
    } else { //otherwise default to EMAIL_FROM and store name
    $send_to_email = EMAIL_FROM;
    $send_to_name = STORE_NAME;
    }

    Maybe I'm way off?! Thanks.

  2. #2
    Join Date
    Jan 2004
    Posts
    58,469
    Blog Entries
    3
    Plugin Contributions
    111

    Default Re: make a form to go to a different email address

    I showed someone how to do exactly that in this older thread: http://www.zen-cart.com/showthread.p...ata-collection
    You'll see the discussion and if you follow it far enough you'll see exactly what you need to do.

    The newer posts in that thread (last 6 months) have gotten quite off topic and unfortunately have nothing to do with the original question anymore. But the stuff before that will be useful to you.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donations always welcome: www.zen-cart.com/donate

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Mar 2010
    Location
    NY - Hudson Valley
    Posts
    30
    Plugin Contributions
    0

    Default Re: make a form to go to a different email address

    Quote Originally Posted by DrByte View Post
    I showed someone how to do exactly that in this older thread: http://www.zen-cart.com/showthread.p...ata-collection
    You'll see the discussion and if you follow it far enough you'll see exactly what you need to do.

    The newer posts in that thread (last 6 months) have gotten quite off topic and unfortunately have nothing to do with the original question anymore. But the stuff before that will be useful to you.
    thank you Dr. Byte.

    Here is what I did - it's working.

    Defined in the incl/template/yourtemplatename/templates/tpl_newname_default.php

    define('SEND_TO_ADDRESS','addressyouwant@whatever.com ');
    removed: define('SEND_TO_TEXT','Send Email To:');


    modifed as follows in the includes/modules/pages/newpagename/header.php

    // use contact us dropdown if defined
    if (CONTACT_US_LIST ==''){
    $send_to_array=explode("," ,CONTACT_US_LIST);
    preg_match('/\<[^>]+\>/', $send_to_array[$_POST['send_to']], $send_email_array);
    $send_to_email= eregi_replace (">", "", $send_email_array[0]);
    $send_to_email= eregi_replace ("<", "", $send_to_email);
    $send_to_name = preg_replace('/\<[^*]*/', '', $send_to_array[$_POST['send_to']]);
    } else { //otherwise default to EMAIL_FROM and store name - CHANGED TO SENDTOADDRESS and defined in credit_application.php
    $send_to_email = SEND_TO_ADDRESS;
    $send_to_name = STORE_NAME;
    }

    This seems to be working for my form. I had to mark the (CONTACT_US_LIST!='') to (CONTACT_US_LIST=='') in the above section because the site is using a list. This doesn't seem like the right way to do it, but it worked for me. If anyone wants to tell me the correct way to code this, it would be appreciated. Thanks!!

  4. #4
    Join Date
    Jan 2004
    Posts
    58,469
    Blog Entries
    3
    Plugin Contributions
    111

    Default Re: make a form to go to a different email address

    You probably could have deleted that whole section of code and just kept this part:
    Code:
    $send_to_email = SEND_TO_ADDRESS;
        $send_to_name =  STORE_NAME;
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donations always welcome: www.zen-cart.com/donate

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Mar 2010
    Location
    NY - Hudson Valley
    Posts
    30
    Plugin Contributions
    0

    Default Re: make a form to go to a different email address

    thanks! I'll try that.

 

 

Similar Threads

  1. Replies: 0
    Last Post: 29 Nov 2010, 12:45 PM
  2. form validation - email address field
    By kwright in forum General Questions
    Replies: 1
    Last Post: 18 Sep 2010, 01:52 AM
  3. How do I make Address line 2 compulsory in the create account form?
    By Liamv in forum Customization from the Admin
    Replies: 3
    Last Post: 3 Mar 2010, 09:12 PM

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
  •