deech123 Posted October 26, 2015 Share Posted October 26, 2015 Hi, I have my own script that import the track & trace codes automatically. I will program a page where in cronjob I update the orders where a track code is available in my extended csv file. this is no problem at all, but I do want to know this : what kind of code do I need to send the email automatically to the client with the code? i use something simular to send an email when I automatically change status with an other script like this : $order = new Order($Id_order); $order->setCurrentState(3); any idea if there excist also something to use the normal classes to send the email matching the ordernumber? thx for any tip or clue. D. Link to comment Share on other sites More sharing options...
taydotech123 Posted October 26, 2015 Share Posted October 26, 2015 you should use Class Email in prestashop for sent emaill Link to comment Share on other sites More sharing options...
deech123 Posted October 26, 2015 Author Share Posted October 26, 2015 Taydotech, any idea what the correct code is for that? Link to comment Share on other sites More sharing options...
taydotech123 Posted October 26, 2015 Share Posted October 26, 2015 you should post your code at here, so I can help you Link to comment Share on other sites More sharing options...
deech123 Posted October 26, 2015 Author Share Posted October 26, 2015 Hi, that's just the question. what I need is some code like this : $order = new Order($Id_order); $order->setCurrentState(3); I will have the ID_order, and then I will say : update ps_order_carrier, set trackcode = a parameter I will give, where ordernumber= (then the custom ordernumber) that's all no problem, but after updating the order_carrier table with track and trace code, i want to automatically send the email to the client, without any manual handling. like you see the code example hereabove is to update the currentstate of an order, what I need is something simular to email the client the data oftrack and trace. ;-) Link to comment Share on other sites More sharing options...
deech123 Posted October 30, 2015 Author Share Posted October 30, 2015 Nobody that knows what class I should call to send the email with the tracking number automatically? I hope somebody can help me out here :-) Link to comment Share on other sites More sharing options...
deech123 Posted October 30, 2015 Author Share Posted October 30, 2015 For the info, I need the piece of code that I can use in PHP after I do some stuff and then the update like : $sql2 = "UPDATE `ps_order_carrier` SET tracking_number=$tracknummer WHERE id_order=$id_order"; after this code I want to call a class to send the email with trackcode to the client. this is not done on the backend administration, this is runned by special PHP page an cronjob. hope somebody knows where I can look of give me the piece of code where you can just set the Id order or orderreference. D Link to comment Share on other sites More sharing options...
deech123 Posted October 30, 2015 Author Share Posted October 30, 2015 update : this code works allready perfect : $order_carrier = new OrderCarrier($id_order_carrier); $order_carrier->tracking_number = $shipping_number; $order_carrier->update(); where shipping_number is my tracking-number. what is the exact extra code needed to send out the email automatically (when I do it manualy in the BO, then it works perfect :-) ) but I want to call it thru a PHP file. hope somebody can tell me what I miss...I can not find. D. Link to comment Share on other sites More sharing options...
deech123 Posted December 14, 2015 Author Share Posted December 14, 2015 nobody that can help me out to send the correct email after i updated the track number by an own made php script? :-( Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now