acpkor Posted March 25, 2022 Share Posted March 25, 2022 Hello, I want that when placing an order, depending on the store, I send a confirmation email or another. does anyone know if it can be done Link to comment Share on other sites More sharing options...
knacky Posted March 26, 2022 Share Posted March 26, 2022 Who? To the customer or employees? 1 Link to comment Share on other sites More sharing options...
acpkor Posted March 26, 2022 Author Share Posted March 26, 2022 In principle, I am interested in the client's. The ones in the /mails/en/ folder I wish a different "order_conf.html" could be sent depending on the store. I suppose that it could be done by creating another mail template "xxxxx.html", for the second store, but in some place or form, I have to tell it to send it if it is that second store. Link to comment Share on other sites More sharing options...
ps8modules Posted March 26, 2022 Share Posted March 26, 2022 (edited) You will need to edit the ./classes/PaymentModule.php file Find the Mail::Send function and enter your own condition. Edited March 26, 2022 by 4you.software (see edit history) 1 Link to comment Share on other sites More sharing options...
endriu107 Posted March 26, 2022 Share Posted March 26, 2022 Each strore can have own theme and each theme can have own email templates, I think thisos easiest way to create mail folder in every theme and put there own email template files. 1 Link to comment Share on other sites More sharing options...
knacky Posted March 26, 2022 Share Posted March 26, 2022 (edited) Well, I don't know which is easier. Whether to configure each template separately for each e-shop, or simply edit one file. Before: After: Edited March 26, 2022 by knacky (see edit history) 1 Link to comment Share on other sites More sharing options...
acpkor Posted March 26, 2022 Author Share Posted March 26, 2022 hello thank you very much for your answers I have these lines in the file: /classes/PaymentModule.php if (self::DEBUG_MODE) { PrestaShopLogger::addLog('PaymentModule::validateOrder - Mail is about to be sent', 1, null, 'Cart', (int) $id_cart, true); } $orderLanguage = new Language((int) $order->id_lang); if (Validate::isEmail($this->context->customer->email)) { Mail::Send( (int) $order->id_lang, 'order_conf', Context::getContext()->getTranslator()->trans( 'Order confirmation', array(), 'Emails.Subject', $orderLanguage->locale ), $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 ); } } it's fine? How would I put the code? Link to comment Share on other sites More sharing options...
knacky Posted March 27, 2022 Share Posted March 27, 2022 (edited) Yes, PaymentModule.php It's just a demonstration of how to do it. The condition of verifying the existence is still missing in the example email templates and default email template settings. I will ask colleagues, he will definitely have a module for that. Edited March 27, 2022 by knacky (see edit history) 1 Link to comment Share on other sites More sharing options...
acpkor Posted March 30, 2022 Author Share Posted March 30, 2022 Thank you very much for example. I have created the mail templates and modified the file I have applied it and it works fine. Thanks! if I wanted to do the same with the email that the employee receives which file/class should I modify? Link to comment Share on other sites More sharing options...
knacky Posted March 30, 2022 Share Posted March 30, 2022 ./modules/ps_emailalerts/ps_emailalerts.php 2 Link to comment Share on other sites More sharing options...
acpkor Posted March 30, 2022 Author Share Posted March 30, 2022 Thanks! 1 Link to comment Share on other sites More sharing options...
knacky Posted March 30, 2022 Share Posted March 30, 2022 You can thank me by clicking on the gray heart below my posts 😉 1 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