domorodecmezilidmi Posted January 20, 2015 Share Posted January 20, 2015 (edited) Hi guys, I would like to ask you one thing. How to make, that customer will receive as the first email confirmation of order, and THEN instructions for bank wire? Now it works that he receives firstly bank wire email and then just in few milliseconds later order confirmation. Thank you for this easy help Edited January 20, 2015 by domorodecmezilidmi (see edit history) Link to comment Share on other sites More sharing options...
domorodecmezilidmi Posted January 23, 2015 Author Share Posted January 23, 2015 (edited) Anybody here to advice? I think that logically customer should receive firstly order confirmation and then bank wire email but for me it works on the contrary. Edited January 26, 2015 by domorodecmezilidmi (see edit history) Link to comment Share on other sites More sharing options...
Eutanasio Posted February 12, 2015 Share Posted February 12, 2015 I'm not sure how I did that, but try going to Orsders-> Status -> Bankwire uncheck the send email when change to this status and save. Then access again and check again that option, assign it to the bankwire module and save. 1 Link to comment Share on other sites More sharing options...
domorodecmezilidmi Posted February 13, 2015 Author Share Posted February 13, 2015 Hi, thank you, I will do that. Link to comment Share on other sites More sharing options...
domorodecmezilidmi Posted February 13, 2015 Author Share Posted February 13, 2015 Sorry, but doesn´t work, still the same. I am not keen with programming but seems very weird. Link to comment Share on other sites More sharing options...
Scully Posted June 28, 2017 Share Posted June 28, 2017 (edited) Just a hint, look at classes/PaymentModule.php Search for these lines.... appx. around line 770. This is the part where the new order status (awaiting bankwire payment) is set and this part also sends the bank wire confirmation on the last line. $new_history = new OrderHistory();$new_history->id_order = (int)$order->id;$new_history->changeIdOrderState((int)$id_order_state, $order, true);$new_history->addWithemail(true, $extra_vars); And move them down below these following lines:This is where the actual order confirmation is sent. if (Validate::isEmail($this->context->customer->email)) { Mail::Send( (int)$order->id_lang, 'order_conf', Mail::l('Order confirmation', (int)$order->id_lang), $data, $this->context->customer->email, $this->context->customer->firstname.' '.$this->context->customer->lastname, null, null, $file_attachement, null, _PS_MAIL_DIR_, false, (int)$order->id_shop ); } If it still does not work, try with additional line sleep(1);This delays the process of sending the bankwire email by 1 second. Why? It is possible that the second mail might overtake the frist one. By delaying a bit, we can get rid of this behavior in most of the cases. $new_history = new OrderHistory();$new_history->id_order = (int)$order->id;$new_history->changeIdOrderState((int)$id_order_state, $order, true);sleep(1);$new_history->addWithemail(true, $extra_vars); Edited June 28, 2017 by Scully (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts