al_foto Posted January 14, 2013 Share Posted January 14, 2013 Is it possible to change the "from" email address for the copy of the order I receive ? Now it's send from the shop email address but it's very hard to find orders in my inbox if searching by customer email address because I have to look in the email body, therefore I would like to have the customer email addres in the from field or at least in the subject. Thanks. Link to comment Share on other sites More sharing options...
PascalVG Posted January 14, 2013 Share Posted January 14, 2013 I hope I understood which Email you mean, but if you want to have an Email address in the subject of your "Order Confirmation" email, you can Edit the file classes/PaymentModule.php Find the line Mail::l('Order confirmation', (int)$order->id_lang), and change into (add to): Mail::l('Order confirmation', (int)$order->id_lang).'. Order by '.$this->context->customer->email, (don't overlook the 3 periods (".") ) This gives the Customer Email in the subject line, after the Original "[shop name] Order confirmation" Beware that when upgrading your shop needs manually editing this file again (and again...) Hope this helps, Pascal 1 Link to comment Share on other sites More sharing options...
al_foto Posted January 14, 2013 Author Share Posted January 14, 2013 Thanks for your answer. The order confirmation in PaymentModule.php is sent to the customer if I'm right, but I need that the "New order" email I receive includes the customer email. I guess this should be in the mailalerts module, will take a look and may be I can apply something like your proposal. Link to comment Share on other sites More sharing options...
PascalVG Posted January 14, 2013 Share Posted January 14, 2013 Other option: Just see that if you want the sender to be the original customer's Email address you can edit as follows: close to the changes as decribed in comment above(in the mail::send( ) function ) a few lines under these, you see a 3 lines null, null, $file_attachement, change this into: null, $this->context->customer->email, $file_attachement,... (N.B. the changed parameter should be the 8th parameter of the Send() function, at least in Prestashop 1.5.2) So, you can choose which change you prefer, or do both, to make it all complete :-) Hope this helps, pascal --------------------------------------------------------- www.PhelineOnline.com www.KidsAndMum.com www.ModulesModules.com 1 Link to comment Share on other sites More sharing options...
al_foto Posted January 14, 2013 Author Share Posted January 14, 2013 Done, have changed the line: sprintf(Mail::l('New order - #%06d', $id_lang), $order->id), to sprintf(Mail::l('New order - #%06d', $id_lang), $order->id)." "."by: ".$customer->email, in mailalerts.php in the mailalerts module. Seems to work. Thanks for showing me the way to go 1 Link to comment Share on other sites More sharing options...
PascalVG Posted January 14, 2013 Share Posted January 14, 2013 (edited) Nice! Enjoy! Edited January 14, 2013 by PascalVG (see edit history) Link to comment Share on other sites More sharing options...
PascalVG Posted January 14, 2013 Share Posted January 14, 2013 You can also here in mailalerts.php change the sender (on param 8 of the send() function) to the original sender: change from: $configuration['PS_SHOP_EMAIL'] to $customer->email :-) Link to comment Share on other sites More sharing options...
al_foto Posted January 14, 2013 Author Share Posted January 14, 2013 Yes, have just seen and tried, works nice. Thanks so much The drawback is that I will never be able to update because I'm making to many changes. Link to comment Share on other sites More sharing options...
PascalVG Posted January 14, 2013 Share Posted January 14, 2013 (edited) 1) Make notes (at least of files changed) 2) keep copy of original files (original installation files 3) Do a file compare on the changed files Maybe it helps. I heard that in prestashop 1.5 you can overload functions (i.e. add/change functionality). See developers guides for details, but I understood you can change behaviour without touching the original files, (little bit like themes...) Edited January 14, 2013 by PascalVG (see edit history) Link to comment Share on other sites More sharing options...
al_foto Posted January 14, 2013 Author Share Posted January 14, 2013 I'm making notes for the changes but it will be a hard word in case I decide to update, will take a look at the overload feature. Link to comment Share on other sites More sharing options...
PascalVG Posted January 14, 2013 Share Posted January 14, 2013 Tiny detail: the 'by: ' will not be translated in our changes. You can add it to the mail::l() in the front if needed or give it it's own translation field ( mail::l('by: ') ) For those who care... Link to comment Share on other sites More sharing options...
bellini13 Posted January 14, 2013 Share Posted January 14, 2013 the 'correct' way of making custom changes to modules, is to make a copy of the module, rename it (ie mailalerts to mailalerts2), and then make the changes to the copy. then disable the original module. this way during upgrades you will know that you made a customization, since the upgrade process will warn you of the custom module 2 Link to comment Share on other sites More sharing options...
PascalVG Posted January 15, 2013 Share Posted January 15, 2013 Hi Bellini, Thanks for sharing that! Simple and efficient :-) 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