Jump to content
YePix

Duplicate order mail

Recommended Posts

1 minute ago, mcmannehan said:

If no issue in the code, than this is the only logical answer.

If this fix the problem, so i ask again:  why the SEND_EXTRA_ORDER_EMAILS_TO is filled with the customer e-mail address??? 

I think there is an loop send email somewhere


Get the latest Responsive osCommerce CE (community edition) here .

Share this post


Link to post
Share on other sites
2 minutes ago, YePix said:

No.

Shop email address
Email from
and additional order mail to admin is always the same email address

And the e-mail of the customer test account is different?

If you comment out the above snippet and it stops duplicating mails, there is no logic.

Share this post


Link to post
Share on other sites
vor 2 Minuten schrieb raiwa:

And the e-mail of the customer test account is different?

If you comment out the above snippet and it stops duplicating mails, there is no logic.

Yes that's it. That's the problem and I can not explain why it is

Share this post


Link to post
Share on other sites
Just now, YePix said:

No.

Shop email address
Email from
and additional order mail to admin is always the same email address

You don't get it or???
so do the follow:

Change the customer email address this shoudn't be the same like the shop email

Change the additional email address to the shop email than you shoud get 2 Admin emails and 1 customer email.

after your explanation: additional order mail is the same like the customer email address

so @raiwa is abolut right with:

25 minutes ago, raiwa said:

You probably have the test account setup with the same mail like the store owners mail. That's because you get it twice, one for the customer another for the store owner.

 

Other explanation: Some issue elsewhere...


  • The clever one learn from everything and from everybody
  • The normal one learn from his experience
  • The silly one knows everything better

[socrates, 412 before Christ]

Computers help us with the problems we wouldn't have without them!
99.9% of the bugs sit in front of the computer!
My programmed add-ons: WDW EasyTabs 1.0.3, WDW Facebook Like 1.0.0

if(isset($this) || !isset($this)){ // that's the question...

 

Share this post


Link to post
Share on other sites
Posted (edited)

You could also just have a look in the database configuration table  for SEND_EXTRA_ORDER_EMAILS_TO to check what is defined there.

 

Edited by raiwa

Share this post


Link to post
Share on other sites
vor 3 Minuten schrieb mcmannehan:

You don't get it or???
so do the follow:

Change the customer email address this shoudn't be the same like the shop email

Change the additional email address to the shop email than you shoud get 2 Admin emails and 1 customer email.

after your explanation: additional order mail is the same like the customer email address

so @raiwa is abolut right with: 

 

Other explanation: Some issue elsewhere...

Shopemail is: info@shopmail.com
Customer Mail is: kunde@bestellung.com
As you can see, the two do not agree

Share this post


Link to post
Share on other sites
Posted (edited)
10 minutes ago, YePix said:

Yes that's it. That's the problem and I can not explain why it is

SEND_EXTRA_ORDER_EMAILS_TO  is filled with the customer email address. So check all the code and the files with that variable. May be elsewhere
varibale is filled with the customer address.

 

13 minutes ago, raiwa said:

And the e-mail of the customer test account is different?

If you comment out the above snippet and it stops duplicating mails, there is no logic.

@raiwa i agree with you 1000000%, no logic!!!!!!!!!!!!

Edited by mcmannehan

  • The clever one learn from everything and from everybody
  • The normal one learn from his experience
  • The silly one knows everything better

[socrates, 412 before Christ]

Computers help us with the problems we wouldn't have without them!
99.9% of the bugs sit in front of the computer!
My programmed add-ons: WDW EasyTabs 1.0.3, WDW Facebook Like 1.0.0

if(isset($this) || !isset($this)){ // that's the question...

 

Share this post


Link to post
Share on other sites
vor 3 Minuten schrieb raiwa:

You could also just have a look in the database configuration table  for SEND_EXTRA_ORDER_EMAILS_TO to check what is defined there.

 

absolutely normal, store owner emailaddress

Share this post


Link to post
Share on other sites
2 minutes ago, YePix said:

Shopemail is: info@shopmail.com
Customer Mail is: kunde@bestellung.com
As you can see, the two do not agree

and additional order mail is ???


  • The clever one learn from everything and from everybody
  • The normal one learn from his experience
  • The silly one knows everything better

[socrates, 412 before Christ]

Computers help us with the problems we wouldn't have without them!
99.9% of the bugs sit in front of the computer!
My programmed add-ons: WDW EasyTabs 1.0.3, WDW Facebook Like 1.0.0

if(isset($this) || !isset($this)){ // that's the question...

 

Share this post


Link to post
Share on other sites
vor 3 Minuten schrieb mcmannehan:

and additional order mail is ???

info@shopmail.com

Share this post


Link to post
Share on other sites
2 minutes ago, YePix said:

absolutely normal, store owner emailaddress

Shopemail is: info@shopmail.com
Customer Mail is: kunde@bestellung.com

so you will get normaly:

Shopemail is: info@shopmail.com <--- 2 order mails to this email
Customer Mail is: kunde@bestellung.com <--- 1 order mails to this email

if you get:

Shopemail is: info@shopmail.com <--- 1 order mails to this email
Customer Mail is: kunde@bestellung.com <--- 2 order mails to this email

Than your code have a issue elsewhere!!!

 

In my opinion: Check your email client and check the sender.


  • The clever one learn from everything and from everybody
  • The normal one learn from his experience
  • The silly one knows everything better

[socrates, 412 before Christ]

Computers help us with the problems we wouldn't have without them!
99.9% of the bugs sit in front of the computer!
My programmed add-ons: WDW EasyTabs 1.0.3, WDW Facebook Like 1.0.0

if(isset($this) || !isset($this)){ // that's the question...

 

Share this post


Link to post
Share on other sites
Posted (edited)

an it's still what the people said to you: Same email in shop and additional so thats why you get order email twice.

Shopemail is: info@shopmail.com
Customer Mail is: kunde@bestellung.com
Additional order mail is :info@shopmail.com

Than everthing should work well and you get

Shopemail is: info@shopmail.com <--- 2 order mails to this email
Customer Mail is: kunde@bestellung.com <--- 1 order mails to this email

Check the sender in your email client!!!

Now no further info... have a nice day!!!

Edited by mcmannehan

  • The clever one learn from everything and from everybody
  • The normal one learn from his experience
  • The silly one knows everything better

[socrates, 412 before Christ]

Computers help us with the problems we wouldn't have without them!
99.9% of the bugs sit in front of the computer!
My programmed add-ons: WDW EasyTabs 1.0.3, WDW Facebook Like 1.0.0

if(isset($this) || !isset($this)){ // that's the question...

 

Share this post


Link to post
Share on other sites
Posted (edited)
17 minutes ago, mcmannehan said:

SEND_EXTRA_ORDER_EMAILS_TO  is filled with the customer email address. So check all the code and the files with that variable. May be elsewhere
varibale is filled with the customer address.

This would be the only logical explanation, but there is very little probability for a constant (it's a constant, not a variable) to get redefined. A quite specific code is required to do so.

define('SEND_EXTRA_ORDER_EMAILS_TO', 'info@mailaddress.com');

or:

   const SEND_EXTRA_ORDER_EMAILS_TO     = 'info@mailaddress.com';

 

Edited by raiwa

Share this post


Link to post
Share on other sites
24 minutes ago, Omar_one said:

I think there is an loop send email somewhere

I can see there is 3 add-ons installed  .. maybe send email loop somewhere


Get the latest Responsive osCommerce CE (community edition) here .

Share this post


Link to post
Share on other sites
Posted (edited)
4 minutes ago, Omar_one said:

I can see there is 3 add-ons installed  .. maybe send email loop somewhere

neither PWA nor Points and rewards sends mails. They only modify the order mail content. (supposed they have not been modified).

He tried already with PWA commented out, no effect. But yes, best would be to try with a complete original checkout process file and check if the same happens.

Which was the third Addon?

Edited by raiwa

Share this post


Link to post
Share on other sites

i changed this
 

// 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);
  }

in
 

// send emails to other people
  if (SEND_EXTRA_ORDER_EMAILS_TO != '') {
    tep_mail('', 'info@shopmail.com', EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
  }

no reaction. it will continue to receive duplicate emails

Share this post


Link to post
Share on other sites
Am 24.8.2019 um 12:20 schrieb YePix:

and this my classes/mail
 


  require_once 'ext/modules/PHPMailer/class.phpmailer.php';
  $phpMail = new PHPMailer();
  class email {
    var $html;
    var $text;
    var $html_text;
    var $lf;
    var $debug = 0;
    var $debug_output = 'error_log';
    function email($headers = '') {
      global $phpMail;
      $phpMail->XMailer = 'osCommerce Mailer ' . tep_get_version();
      $phpMail->SMTPDebug = $this->debug;
      $phpMail->Debugoutput = $this->debug_output;
      $phpMail->CharSet = CHARSET;
      $phpMail->WordWrap = 998;
      if (EMAIL_LINEFEED == 'CRLF') {
        $this->lf = "\r\n";
      } else {
        $this->lf = "\n";
      }
    }
    function add_text($text = '') {
      global $phpMail;
      $phpMail->IsHTML(false);
      $this->text = tep_convert_linefeeds(array("\r\n", "\n", "\r"), $this->lf, $text);
    }
    function add_html($html, $text = NULL, $images_dir = NULL) {
      global $phpMail;
      $phpMail->IsHTML(true);
      $this->html = tep_convert_linefeeds(array("\r\n", "\n", "\r"), '<br />', $html);
      $this->html_text = tep_convert_linefeeds(array("\r\n", "\n", "\r"), $this->lf, $text);
      if (isset($images_dir)) $this->html = $phpMail->msgHTML($this->html, $images_dir);
    }
    function add_attachment($path, $name = '', $encoding = 'base64', $type = '', $disposition = 'attachment') {
      global $phpMail;
      $phpMail->AddAttachment($path, $name, $encoding, $type, $disposition);
    }
    function build_message() {
      //out of work function
    }
    function send($to_name, $to_addr, $from_name, $from_addr, $subject = '', $reply_to = false) {
      global $phpMail;
      if ((strstr($to_name, "\n") != false) || (strstr($to_name, "\r") != false)) {
        return false;
      }
      if ((strstr($to_addr, "\n") != false) || (strstr($to_addr, "\r") != false)) {
        return false;
      }
      if ((strstr($subject, "\n") != false) || (strstr($subject, "\r") != false)) {
        return false;
      }
      if ((strstr($from_name, "\n") != false) || (strstr($from_name, "\r") != false)) {
        return false;
      }
      if ((strstr($from_addr, "\n") != false) || (strstr($from_addr, "\r") != false)) {
        return false;
      }
      $phpMail->From = $from_addr;
      $phpMail->FromName = $from_name;
      $phpMail->AddAddress($to_addr, $to_name);
      if ($reply_to) {
        $phpMail->AddReplyTo(EMAIL_SMTP_REPLYTO, STORE_NAME);
      } else {
        $phpMail->AddReplyTo($from_addr, $from_name);
      }
      $phpMail->Subject = $subject;
      if (!empty($this->html)) {
        $phpMail->Body = $this->html;
        $phpMail->AltBody = $this->html_text;
      } else {
        $phpMail->Body = $this->text;
      }
      if (EMAIL_TRANSPORT == 'smtp' || EMAIL_TRANSPORT == 'gmail') {
        $phpMail->IsSMTP();
        $phpMail->Host = EMAIL_SMTP_HOSTS;
        $phpMail->SMTPAuth = EMAIL_SMTP_AUTHENTICATION;
        $phpMail->Username = EMAIL_SMTP_USER;
        $phpMail->Password = EMAIL_SMTP_PASSWORD;
        if (EMAIL_TRANSPORT == 'gmail') {
          $phpMail->Port = 465;
          $phpMail->SMTPSecure = 'ssl';
        }
      } else {
        $phpMail->isSendmail();
      }
      if (!$phpMail->Send()) {
        return false;
      }
      return true;
    }
  }
/* ** Altered for Mail Manager ** */
// eliminate line feeds as <br>
  class emailMailManager extends email { 
	function add_html($html, $text = NULL, $images_dir = NULL) {
	  $this->html = $html; //tep_convert_linefeeds(array("\r\n", "\n", "\r"), '<br>', $html);
	  $this->html_text = tep_convert_linefeeds(array("\r\n", "\n", "\r"), $this->lf, $text);
	  if (isset($images_dir)) $this->find_html_images($images_dir);
	}
  }
/* ** EOF alterations for Mail Manager ** */

 

I see the interest in this post is great.
Here is the solution for the class email:

        }
      } else {
        $phpMail->isSendmail();
      }
      if (!$phpMail->Send()) {
        return false;
      }
      $phpMail->clearAddresses();
      return true;
    }
  }

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×