unnati Posted September 3, 2014 Share Posted September 3, 2014 (edited) I want to know prestashop has default functionality to send email about voucher code to customer on voucher created or on voucher is assign to specific customer ??? Thanks Edited September 3, 2014 by unnati (see edit history) Link to comment Share on other sites More sharing options...
Sam Minerve Posted September 4, 2014 Share Posted September 4, 2014 Hi, It seems that, in this case, there is no e-mail sent to the customer. Yet, it would be right to let him know there is a voucher for him. Unfortunately, I don't know how to achieve this. All help is welcome ! Thanks in advance. 1 Link to comment Share on other sites More sharing options...
unnati Posted September 5, 2014 Author Share Posted September 5, 2014 Thanks Sam for reply i worked on how to achieving this... Link to comment Share on other sites More sharing options...
vekia Posted September 5, 2014 Share Posted September 5, 2014 prestashop hasn't got this feature to sent an email to customer when the voucher code is created is necessary to edit the admin cart rules controller for example in afterAdd() funciton at the end you can add function to send and email (with mail::send() function) to customer defined in $currentObject->customer variable controllers/front/admin/adminCartRulesController.php 1 Link to comment Share on other sites More sharing options...
Sam Minerve Posted September 5, 2014 Share Posted September 5, 2014 Thank you vekia for your help, I've tried some coding, but since I'm worthless in programming, it doesn't work. :/ So, in "controllers/admin/adminCartRulesController.php file", in the "afterAdd()" function, I put this code : $vars = array( '{lastname}' => $customer->lastname, '{firstname}' => $customer->firstname, '{name}' => $cart_rule->name, '{code}' => $cart_rule->code ); Mail::Send((int)$order->id_lang, 'discount', Mail::l('Your order discount', $order->id_lang), $vars, $customer->email, $customer->firstname.' '.$customer->lastname, null, null, null, null, _PS_MAIL_DIR_, true, (int)$order->id_shop); I created 2 files named "discount.html" and "discount.txt" in the "mails" directory. But according to the error message, "the $to variable is corrupted". I don't know what it means... I just want to create an e-mail including the name, the value and the code of the voucher... 1 Link to comment Share on other sites More sharing options...
Bojo2 Posted September 6, 2014 Share Posted September 6, 2014 prestashop hasn't got this feature Seems like a fantastic idea for a feature. Simple toe execute and very beneficial! Link to comment Share on other sites More sharing options...
Recommended Posts