Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

multiple emails


zpupster

Recommended Posts

hello support,

 

i have multiple  forms on my site.  the forms need to be sent to different email accounts.

 

presently they all go to the store owner. ( using the contact_us.php code)

 

 

but it should be like this:

 

form1.php -- form1 to  email account --contact1@@Contact.com

 

form2.php --form2 to contact2@@Contact.com

 

 

i can not find the variable for the store owner email, i am thinking of  creating new variable and replacing where it needs to be placed(????? need help here also)

 

if can think of an easier way or have seen an addon for this 

your suggestion owuld be very welcome.

 

ty 

craig

form1 to contact @ contact.com

Link to comment
Share on other sites

The form is processed in the top part of the page. The code looks like this:

      tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $enquiry, $name, $email_address);

The constant STORE_OWNER_EMAIL_ADDRESS is what you want to change. You can just replace it with the address you want to use:

      tep_mail(STORE_OWNER, 'somebody@[member=Example].com', EMAIL_SUBJECT, $enquiry, $name, $email_address);

but don't forget the quote marks (as shown).

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

this off new page tech.php

 

 



<?php
/*
  $Id$


  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com


  Copyright (c) 2010 osCommerce


  Released under the GNU General Public License
*/


  require('includes/application_top.php');


  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_TECH);
  
  
  
   if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'send') && isset($HTTP_POST_VARS['formid']) && ($HTTP_POST_VARS['formid'] == $sessiontoken)) {
    $error = false;


    $name = tep_db_prepare_input($HTTP_POST_VARS['name']);
    $email_address = tep_db_prepare_input($HTTP_POST_VARS['email']);
    $enquiry = tep_db_prepare_input($HTTP_POST_VARS['enquiry']);


    if (!tep_validate_email($email_address)) {
      $error = true;


      $messageStack->add('contact', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
    }


    $actionRecorder = new actionRecorder('ar_contact_us', (tep_session_is_registered('customer_id') ? $customer_id : null), $name);
    if (!$actionRecorder->canPerform()) {
      $error = true;


      $actionRecorder->record(false);




      $messageStack->add('contact', sprintf(ERROR_ACTION_RECORDER, (defined('MODULE_ACTION_RECORDER_CONTACT_US_EMAIL_MINUTES') ? (int)MODULE_ACTION_RECORDER_CONTACT_US_EMAIL_MINUTES : 15)));
    }


    if ($error == false) {
      tep_mail(STORE_OWNER, 'techsupport@[member='MySitesOnline'].com', EMAIL_SUBJECT, $enquiry, $name, $email_address);


      $actionRecorder->record();


      tep_redirect(tep_href_link(FILENAME_TECH, 'action=success'));
    }
  }


  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_TECH));












  require(DIR_WS_INCLUDES . 'template_top.php');
?>


<div class="page-header">
  <h1><?php echo HEADING_TITLE; ?></h1>
</div>




 <?php echo TEXT_INFORMATION; ?>
<?php
  if ($messageStack->size('contact') > 0) {
    echo $messageStack->output('contact');
  }


  if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'success')) {
?>


<div class="contentContainer">
  <div class="contentText">
    <div class="alert alert-info"><?php echo TEXT_SUCCESS; ?></div>
  </div>


  <div class="pull-right">
    <?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'glyphicon glyphicon-chevron-right', tep_href_link(FILENAME_DEFAULT)); ?>
  </div>
</div>


<?php
  } else {
?>
<div class="page-header">
  <h1><?php echo HEADING_TITLE; ?> Form</h1>
</div>
<?php echo tep_draw_form('contact_us', tep_href_link(FILENAME_TECH, 'action=send'), 'post', 'class="form-horizontal"', true); ?>


<div class="contentContainer">
  <div class="contentText_left">
  
    <p class="inputRequirement text-right"><?php echo FORM_REQUIRED_INFORMATION; ?></p>
    <div class="clearfix"></div>


    <div class="form-group has-feedback">
      <label for="inputFromName" class="control-label col-sm-3"><?php echo ENTRY_NAME; ?></label>
      <div class="col-sm-9">
        <?php
        echo tep_draw_input_field('name', NULL, 'required autofocus="autofocus" aria-required="true" id="inputFromName" placeholder="' . ENTRY_NAME . '"');
        echo FORM_REQUIRED_INPUT;
        ?>
      </div>
    </div>
    <div class="form-group has-feedback">
      <label for="inputFromEmail" class="control-label col-sm-3"><?php echo ENTRY_EMAIL; ?></label>
      <div class="col-sm-9">
        <?php
        echo tep_draw_input_field('email', NULL, 'required aria-required="true" id="inputFromEmail" placeholder="' . ENTRY_EMAIL . '"', 'email');
        echo FORM_REQUIRED_INPUT;
        ?>
      </div>
    </div>
    <div class="form-group has-feedback">
      <label for="inputEnquiry" class="control-label col-sm-3"><?php echo ENTRY_ENQUIRY; ?></label>
      <div class="col-sm-9">
        <?php
        echo tep_draw_textarea_field('enquiry', 'soft', 50, 15, NULL, 'required aria-required="true" id="inputEnquiry" placeholder="' . ENTRY_ENQUIRY . '"');
        echo FORM_REQUIRED_INPUT;
        ?>
      </div>
    </div>
  </div>
<div class="clearfix"></div>
  <div class="buttonSet">
    <div class="text-right"><?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'glyphicon glyphicon-send', null, 'primary', null, 'btn-success'); ?></div>
  </div>
</div>


</form>
<!--
SiteSeal Html Builder Code:
Shows the logo at URL https://seal.networksolutions.com/images/basicrecblue.gif
Logo type is  ("NETSB")
//-->
<script language="JavaScript" type="text/javascript"> SiteSeal("https://seal.networksolutions.com/images/basicrecblue.gif","NETSB", "none");</script>
<?php
  }


  require(DIR_WS_INCLUDES . 'template_bottom.php');
  require(DIR_WS_INCLUDES . 'application_bottom.php');
?>

Link to comment
Share on other sites

Please paste code in using the code symbol <> in the editor. This prevents the forum software from messing things up.

 

Provided the code that got mangled is actually correct, this should just work. Check that you uploaded the file to the right place.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Did you forget to change the form target to the new page name? If it's still

<?php echo tep_draw_form('contact_us', tep_href_link('contact_us.php', 'action=send'), 'post', 'class="form-horizontal"', true); ?>

then the form results will be processed by the Contact Us page and the code at the top of your new page will never execute.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...