Jump to content


Corporate Sponsors


Latest News: (loading..)

* * * * * 3 votes

Email issues


162 replies to this topic

#121 multimixer

  • Community Sponsor
  • 3,592 posts
  • Real Name:George Zarkadas
  • Gender:Male
  • Location:Greece

Posted 31 March 2010, 13:33

View Postjhande, on 31 March 2010, 13:01, said:

All of my emails & notifications have been working just fine until roughly a month ago when I stopped receiving "new order notifications" purchased through PayPal. Here's a good one, I receive the notification if the customer chooses the option to pay with check or money order. I have not made any changes to my shop at all so I'm really confused why it should break by itself.
Hi Jim

I can not say tat I have any experience with paypal IPN, I never used it and I also don't know exactly how it works. So I can only help with thinking in the same direction as you do

I don't think that the issue is particularly email related, because all other emails and all other confirmations work fine. So I would concentrate on the paypal process

Things I would check are
1) Is the order getting registered in the DB? Do you see it in admin? (Not sure if the IPN module writes the order to the DB before or after the paypal visit, do you know this? )
2) What is the "return" page of paypal to your store? Is it checkout_process.php? Or is it an other file? Does this file has a separate mail function? (like ie paypal_standard.php)
3) Does the customer get the email? I guess not

This all goes to the direction, that maybe the email sending process is not getting activated at all for paypal payments. But thats just an idea, the issue can be something totally different

I'm sorry that I can not give a real answer
Looking for a way to create your own osCommerce template ? click

#122 multimixer

  • Community Sponsor
  • 3,592 posts
  • Real Name:George Zarkadas
  • Gender:Male
  • Location:Greece

Posted 31 March 2010, 15:31

View Postgerm, on 30 March 2010, 23:15, said:

So you have seven parameters:
1. to name
2. to email address
3. email subject
4. email body
5. from name
6. from email address
7. headers
A list of files that include a tep_mail function on the catalog side would be as follows

- checkout_process.php
- contact_us.php
- create_account.php
- password_forgotten.php
- tell_a_friend.php

- includes/modules/payment/cc.php
- includes/modules/payment/chronopay.php
- includes/modules/payment/paypal_standard.php
- includes/modules/payment/sofortuberweisung_direkt.php
- includesmodules/payment/worldpay_junior.php

- ext/modules/payment/paypal/standard_ipn.php
Looking for a way to create your own osCommerce template ? click

#123 jhande

  • Community Member
  • 2,050 posts
  • Real Name:Jim Hande
  • Gender:Male
  • Location:White Mountains, NH USA

Posted 01 April 2010, 18:06

View Postmultimixer, on 31 March 2010, 13:33, said:

Hi Jim

I can not say tat I have any experience with paypal IPN, I never used it and I also don't know exactly how it works. So I can only help with thinking in the same direction as you do

I don't think that the issue is particularly email related, because all other emails and all other confirmations work fine. So I would concentrate on the paypal process
That was my thought, something went wrong with the paypal process.

Quote

Things I would check are
1) Is the order getting registered in the DB? Do you see it in admin? (Not sure if the IPN module writes the order to the DB before or after the paypal visit, do you know this? )
Yes the order gets registered in the DB, can see it in admin. The paypal IPN was designed to hold the order info before the customer leaves the site to head for paypal to finish the process.

Quote

2) What is the "return" page of paypal to your store? Is it checkout_process.php? Or is it an other file? Does this file has a separate mail function? (like ie paypal_standard.php)
Yes it returns to the checkout_process.php.
I double checked the Includes > modules > payment > paypal_ipn.php (no email coding) and the ext > modules > payment > paypal_ipn > ipn.php (email coding) and I had made the neccessary edits as was made in the checkout_process.php as stated in the IPN directions regarding contributions.
Here's the relevant code:
// EOF content type fix by AlexStudio
// $order variables have been changed from checkout_process to work with the variables from the function query () instead of cart () in the order class
//---  Beginning of addition: Ultimate HTML Emails  ---//
if (EMAIL_USE_HTML == 'true') {
require(DIR_WS_MODULES . 'UHtmlEmails/'. ULTIMATE_HTML_EMAIL_LAYOUT .'/checkout_process.php');
$email_order = $html_email;
}else{//Send text email
//---  End of addition: Ultimate HTML Emails  ---//
      	$email_order = STORE_NAME . "\n" . 
                 		EMAIL_SEPARATOR . "\n" . 
                 		EMAIL_TEXT_ORDER_NUMBER . ' ' . $invoice_id . "\n" .
                 		EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $invoice_id, 'SSL', false) . "\n" .
                 		EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n";

      	// BOF order comment fix by AlexStudio
      	if ($comments) {
        	$email_order .= $comments . "\n\n";
      	}
      	// EOF order comment fix by AlexStudio

      	$email_order .= EMAIL_TEXT_PRODUCTS . "\n" . 
                      	EMAIL_SEPARATOR . "\n" . 
                      	$products_ordered . 
                      	EMAIL_SEPARATOR . "\n";

      	for ($i=0, $n=sizeof($order->totals); $i<$n; $i++) {
        	$email_order .= strip_tags($order->totals[$i]['title']) . ' ' . strip_tags($order->totals[$i]['text']) . "\n";
      	}

      	// BOF content type fix by AlexStudio
      	if ($content_type != 'virtual') {
      	// EOF content type fix by AlexStudio
        	$email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" . 
                        	EMAIL_SEPARATOR . "\n" .
                        	tep_address_format($order->delivery['format_id'], $order->delivery,  0, '', "\n") . "\n";
      	}

      	$email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" .
                      	EMAIL_SEPARATOR . "\n" .
                      	tep_address_format($order->billing['format_id'], $order->billing, 0, '', "\n") . "\n\n";
      	if (is_object($$payment)) {
        	$email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" . 
                        	EMAIL_SEPARATOR . "\n";
        	$payment_class = $$payment;
        	$email_order .= $payment_class->title . "\n\n";
        	if ($payment_class->email_footer) { 
          	$email_order .= $payment_class->email_footer . "\n\n";
        	}
      	}
//---  Beginning of addition: Ultimate HTML Emails  ---//
}

if(ULTIMATE_HTML_EMAIL_DEVELOPMENT_MODE === 'true'){
//Save the contents of the generated html email to the harddrive in .htm file. This can be practical when developing a new layout.
$TheFileName = 'Last_mail_from_checkout_process.php.htm';
$TheFileHandle = fopen($TheFileName, 'w') or die("can't open error log file");
fwrite($TheFileHandle, $email_order);
fclose($TheFileHandle);
}
//---  End of addition: Ultimate HTML Emails  ---//
  tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

// send emails to other people
      	if (SEND_EXTRA_ORDER_EMAILS_TO != '') {
        	tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
      	}
    	} // END STATUS == COMPLETED LOOP

    	if ($_POST['payment_status'] == 'Pending') { // START STATUS == PENDING LOOP

      	$email_order = STORE_NAME . "\n" . 
                 		EMAIL_SEPARATOR . "\n" . 
                 		EMAIL_TEXT_ORDER_NUMBER . ' ' . $invoice_id . "\n" .
                 		EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $invoice_id, 'SSL', false) . "\n" .
                 		EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n" . 
                 		EMAIL_SEPARATOR . "\n" .
                 		EMAIL_PAYPAL_PENDING_NOTICE . "\n\n"; 

      	tep_mail($order->customer['name'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

// send emails to other people
      	if (SEND_EXTRA_ORDER_EMAILS_TO != '') {
        	tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
      	} 
    	} // END STATUS == PENDING LOOP


Quote

3) Does the customer get the email? I guess not
No, neither customer or store owner.

Quote

This all goes to the direction, that maybe the email sending process is not getting activated at all for paypal payments. But thats just an idea, the issue can be something totally different

I'm sorry that I can not give a real answer

No problem George. I appreciate the reply anyway.

What has me really stumped and confussed is that on my end (osCommerce files or settings) nothing has changed since it was working about a month ago.

I'll head off and study the PayPal IPN thread and bug my host. Maybe a finger can get pointed as to where the problem might be!?!

Thanks again for at least trying. [img]http://forums.oscommerce.com/public/style_emoticons/default/wink.gif[/img]
- :: Jim :: -
- My Toolbox ~ Adobe Web Bundle & WinMerge | Install ~ osCommerce v2.2 MS2 060817 -
- Not 4 Hire ~ Please DO NOT PM me for help. I really do not have a clue what I am doing! -
- Working on a new 2.3.1 install -

#124 noval

  • Community Member
  • 14 posts
  • Real Name:Noval Assegaf

Posted 13 April 2010, 15:54

I have problem with blank email when I add some field like phone, bank etc for payment confirmation

please help me

Thanks

#125 multimixer

  • Community Sponsor
  • 3,592 posts
  • Real Name:George Zarkadas
  • Gender:Male
  • Location:Greece

Posted 13 April 2010, 16:07

View Postnoval, on 13 April 2010, 15:54, said:

I have problem with blank email when I add some field like phone, bank etc for payment confirmation

please help me

Thanks

Can you be more specific please? What email is blank? In what file you do the changes? In what way you do the changes?
Looking for a way to create your own osCommerce template ? click

#126 noval

  • Community Member
  • 14 posts
  • Real Name:Noval Assegaf

Posted 14 April 2010, 02:44

View Postmultimixer, on 13 April 2010, 16:07, said:

Can you be more specific please? What email is blank? In what file you do the changes? In what way you do the changes?
<?php
/*
  $Id: contact_us.php,v 1.42 2003/06/12 12:17:07 hpdl Exp $

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

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
*/

  require('includes/application_top.php');

  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CONTACT_US);

  $error = false;
  if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'send')) {
        $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']);
        $phone = tep_db_prepare_input($HTTP_POST_VARS['phone']); // add phone 21.6.09
        // BOF multimixer//
        //define variable $email_body.  if you want to add more fields do so by adding this line [ ."\r\n" . ] between the fields you wish to display and order them accordingly//
        $email_body = EMAIL_TEXT_CUSTOMER_NAME . ' ' . $name . "\r\n" . EMAIL_TEXT_CUSTOMER_EMAIL . ' ' .  $email_address . "\r\n" . EMAIL_TEXT_CUSTOMER_PHONE . ' ' . $phone . "\r\n" . EMAIL_TEXT_CUSTOMER_MESSAGE . ' ' . $enquiry;
        //define variable $from_email. Set to Store owner email address as defined in Admin panel. If you want mails to be sent from customers mail address, set it to email_address//
        $from_email = (STORE_OWNER_EMAIL_ADDRESS);
        //EOF multimixer //
        
        //BOF Multimixer//
        // $enquiry replaced by $email_body Includes $email_body to message instead of $enquiry. $email_address replaced by $from_email Email is getting send from $from-email instead of $email_address//
        if (tep_validate_email($email_address)) {
          tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $email_body, $name, $from_email);
          //EOF multimixer//

      tep_redirect(tep_href_link(FILENAME_CONTACT_US, 'action=success'));
    } else {
      $error = true;

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

  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CONTACT_US));
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="0" cellpadding="0">
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
          </tr>
        </table></td>
      </tr>

  <tr>
<!-- body_text //-->
    <td width=552 valign="top"><?php echo tep_draw_form('contact_us', tep_href_link(FILENAME_CONTACT_US, 'action=send')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
      <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
      </tr>
<?php
  if ($messageStack->size('contact') > 0) {
?>
      <tr>
        <td><?php echo $messageStack->output('contact'); ?></td>
      </tr>
      <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
      </tr>
<?php
  }

  if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'success')) {
?>
      <tr>
        <td class="main" align="center"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_man_on_board.gif', HEADING_TITLE, '0', '0', 'align="left"') . TEXT_SUCCESS; ?></td>
      </tr>
      <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
      </tr>
      <tr>
        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
          <tr class="infoBoxContents">
            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr>
                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
                <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
              </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
<?php
  } else {
?>
      <tr>
        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
          <tr class="infoBoxContents">
            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr>
                <td class="main"><?php echo ENTRY_NAME; ?></td>
              </tr>
              <tr>
                <td class="main"><?php echo tep_draw_input_field('name'); ?></td>
              </tr>
              <tr>
                <td class="main"><?php echo ENTRY_EMAIL; ?></td>
              </tr>
              <tr>
                <td class="main"><?php echo tep_draw_input_field('email'); ?></td>
              </tr>
              <tr>
                <td class="main"><?php echo ENTRY_PHONE; ?></td>
              </tr>
              <tr>
                <td class="main"><?php echo tep_draw_input_field('phone'); ?></td>
              </tr>
              <tr>
                <td class="main"><?php echo ENTRY_ENQUIRY; ?></td>
              </tr>
              <tr>
                <td><?php echo tep_draw_textarea_field('enquiry', 'soft', 50, 15); ?></td>
              </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
      </tr>
      <tr>
        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
          <tr class="infoBoxContents">
            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr>
                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
                <td align="right"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
              </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
<?php
  }
?>
    </table></form></td>
<!-- body_text_eof //-->
  </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
only enquiry data I got

#127 multimixer

  • Community Sponsor
  • 3,592 posts
  • Real Name:George Zarkadas
  • Gender:Male
  • Location:Greece

Posted 14 April 2010, 04:40

View Postnoval, on 14 April 2010, 02:44, said:

only enquiry data I got

I'm sorry, but it is really hard to understand what your issue is from your cryptographic messages.

You said you are adding some bank info for some bank confirmation, but this I don't see in the file you posted
You said you get a blank email, now you say you got "just" the enquiry. That means that the file and your email sending system works

Is there nothing else in the mail, for example EMAIL_TEXT_CUSTOMER_NAME? Are the new input fields visible on your page contact_us.php? How does everything work when you use the original file? Did you do any other changes to email related files?
Looking for a way to create your own osCommerce template ? click

#128 noval

  • Community Member
  • 14 posts
  • Real Name:Noval Assegaf

Posted 14 April 2010, 05:18

View Postmultimixer, on 14 April 2010, 04:40, said:

I'm sorry, but it is really hard to understand what your issue is from your cryptographic messages.

You said you are adding some bank info for some bank confirmation, but this I don't see in the file you posted
You said you get a blank email, now you say you got "just" the enquiry. That means that the file and your email sending system works

Is there nothing else in the mail, for example EMAIL_TEXT_CUSTOMER_NAME? Are the new input fields visible on your page contact_us.php? How does everything work when you use the original file? Did you do any other changes to email related files?
I try it from your tutorial page #1 add one phone, could u help me how to make date in phone filed to body message ? if it work I can add some field.

Thanks and sorry my bad engglish

#129 multimixer

  • Community Sponsor
  • 3,592 posts
  • Real Name:George Zarkadas
  • Gender:Male
  • Location:Greece

Posted 14 April 2010, 06:06

View Postnoval, on 14 April 2010, 05:18, said:

I try it from your tutorial page #1 add one phone, could u help me how to make date in phone filed to body message ? if it work I can add some field.

Thanks and sorry my bad engglish

Does the phone field work or not? What exactly do you receive? What fields do you get displayed on contact_us.php? What do you mean with "date in phone"?
Looking for a way to create your own osCommerce template ? click

#130 noval

  • Community Member
  • 14 posts
  • Real Name:Noval Assegaf

Posted 14 April 2010, 06:37

View Postmultimixer, on 14 April 2010, 06:06, said:

Does the phone field work or not? What exactly do you receive? What fields do you get displayed on contact_us.php? What do you mean with "date in phone"?
display on contact_us.php correct there form for phone number but on email I recived the phone number I put there not send to the email

*date = I mean data

#131 noval

  • Community Member
  • 14 posts
  • Real Name:Noval Assegaf

Posted 15 April 2010, 05:11

View Postnoval, on 14 April 2010, 06:37, said:

display on contact_us.php correct there form for phone number but on email I recived the phone number I put there not send to the email

*date = I mean data
help me please , the original contact_us.php work fine but if I add some field like phone doesn't work I get blank body email.

Thanks

#132 multimixer

  • Community Sponsor
  • 3,592 posts
  • Real Name:George Zarkadas
  • Gender:Male
  • Location:Greece

Posted 15 April 2010, 06:20

View Postnoval, on 15 April 2010, 05:11, said:

help me please , the original contact_us.php work fine but if I add some field like phone doesn't work I get blank body email.
Thanks

Replace the file you have with this file. It should work for you since it worked for me and others

Edited by multimixer, 15 April 2010, 06:21.

Looking for a way to create your own osCommerce template ? click

#133 noval

  • Community Member
  • 14 posts
  • Real Name:Noval Assegaf

Posted 15 April 2010, 06:36

View Postmultimixer, on 15 April 2010, 06:20, said:

Replace the file you have with this file. It should work for you since it worked for me and others
Thanks but I got error "Fatal error: Cannot redeclare tep_show_category() (previously declared in /home/benhusc1/public_html/includes/header.php:173) "

#134 noval

  • Community Member
  • 14 posts
  • Real Name:Noval Assegaf

Posted 15 April 2010, 06:40

View Postnoval, on 15 April 2010, 06:36, said:

Thanks but I got error "Fatal error: Cannot redeclare tep_show_category() (previously declared in /home/benhusc1/public_html/includes/header.php:173) "
my header.php line 173 :
function tep_show_category($counter) {

#135 multimixer

  • Community Sponsor
  • 3,592 posts
  • Real Name:George Zarkadas
  • Gender:Male
  • Location:Greece

Posted 15 April 2010, 06:49

View Postnoval, on 15 April 2010, 06:40, said:

my header.php line 173 :
function tep_show_category($counter) {

I can only suggest you to try one more time, start from a virgin file, test how it works, then do the changes as suggested here and test again

Can you also post your url?
Looking for a way to create your own osCommerce template ? click

#136 webart

  • Community Member
  • 58 posts
  • Real Name:Ron
  • Gender:Male
  • Location:Sydney

Posted 15 April 2010, 07:24

View Postmultimixer, on 15 April 2010, 06:49, said:

I can only suggest you to try one more time, start from a virgin file, test how it works, then do the changes as suggested here and test again

Can you also post your url?


Also, make sure you are using the corret type of editor so that your line breaks are okay, this breaks so many pages so often.
Regards Ron

#137 noval

  • Community Member
  • 14 posts
  • Real Name:Noval Assegaf

Posted 15 April 2010, 09:40

View Postmultimixer, on 15 April 2010, 06:49, said:

I can only suggest you to try one more time, start from a virgin file, test how it works, then do the changes as suggested here and test again

Can you also post your url?
my url benhus.com

#138 noval

  • Community Member
  • 14 posts
  • Real Name:Noval Assegaf

Posted 15 April 2010, 09:41

View Postwebart, on 15 April 2010, 07:24, said:

Also, make sure you are using the corret type of editor so that your line breaks are okay, this breaks so many pages so often.
I'm using phpDesigner 7

#139 noval

  • Community Member
  • 14 posts
  • Real Name:Noval Assegaf

Posted 15 April 2010, 09:52

this is my original source code from file contact_us.php from my template

<?php
/*
  $Id: contact_us.php,v 1.42 2003/06/12 12:17:07 hpdl Exp $

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

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
*/

  require('includes/application_top.php');

  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CONTACT_US);

  $error = false;
  if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'send')) {
    $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)) {
      tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $enquiry, $name, $email_address);

      tep_redirect(tep_href_link(FILENAME_CONTACT_US, 'action=success'));
    } else {
      $error = true;

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

  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CONTACT_US));
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="0" cellpadding="0">
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
          </tr>
        </table></td>
      </tr>

  <tr>
<!-- body_text //-->
    <td width=552 valign="top"><?php echo tep_draw_form('contact_us', tep_href_link(FILENAME_CONTACT_US, 'action=send')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
      <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
      </tr>
<?php
  if ($messageStack->size('contact') > 0) {
?>
      <tr>
        <td><?php echo $messageStack->output('contact'); ?></td>
      </tr>
      <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
      </tr>
<?php
  }

  if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'success')) {
?>
      <tr>
        <td class="main" align="center"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_man_on_board.gif', HEADING_TITLE, '0', '0', 'align="left"') . TEXT_SUCCESS; ?></td>
      </tr>
      <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
      </tr>
      <tr>
        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
          <tr class="infoBoxContents">
            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr>
                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
                <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
              </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
<?php
  } else {
?>
      <tr>
        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
          <tr class="infoBoxContents">
            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr>
                <td class="main"><?php echo ENTRY_NAME; ?></td>
              </tr>
              <tr>
                <td class="main"><?php echo tep_draw_input_field('name'); ?></td>
              </tr>
              <tr>
                <td class="main"><?php echo ENTRY_EMAIL; ?></td>
              </tr>
              <tr>
                <td class="main"><?php echo tep_draw_input_field('email'); ?></td>
              </tr>
              <tr>
                <td class="main"><?php echo ENTRY_ENQUIRY; ?></td>
              </tr>
              <tr>
                <td><?php echo tep_draw_textarea_field('enquiry', 'soft', 50, 15); ?></td>
              </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
      </tr>
      <tr>
        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
          <tr class="infoBoxContents">
            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr>
                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
                <td align="right"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
              </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
<?php
  }
?>
    </table></form></td>
<!-- body_text_eof //-->
  </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>



#140 noval

  • Community Member
  • 14 posts
  • Real Name:Noval Assegaf

Posted 15 April 2010, 10:22

original file work fine