Rain_xx Posted March 24, 2014 Share Posted March 24, 2014 Hello, I've got this big issue: 'til Prestashop v1.4 I get to copy a file form my module to the mail folder of my shop with this code: !copy(_PS_MODULE_DIR_.'mails/'.$value.'/myfile.txt',_PS_MAIL_DIR_.'/'.$value.'/myfile.txt') But it doesn't work from v1.5 ...what do I have to change? Thanks a lot. Link to comment Share on other sites More sharing options...
El Patron Posted March 24, 2014 Share Posted March 24, 2014 you do not need to copy mails (for modules), simply create a folder in your module folder called mails. I hope this is what you were looking to solve. Link to comment Share on other sites More sharing options...
Rain_xx Posted March 24, 2014 Author Share Posted March 24, 2014 Thanks for your reply. ..but simply creating the folder, I don't get my email template on the list in "Status order", so I can't select it. Link to comment Share on other sites More sharing options...
El Patron Posted March 24, 2014 Share Posted March 24, 2014 oh, sorry for order states that is different. Here is code I use that works for 1.4-1.5, probably 1.6 as well. copy(dirname(__FILE__).'/../../modules/'.$this->name.'/copymails/en/filename.txt', dirname(__FILE__).'/../../mails/en/filename.txt'); copy(dirname(__FILE__).'/../../modules/'.$this->name.'/copymails/es/filename.html', dirname(__FILE__).'/../../mails/es/filename.html'); one must of course have write access which typically we do unless the shop file owner is not correct... Link to comment Share on other sites More sharing options...
Rain_xx Posted March 24, 2014 Author Share Posted March 24, 2014 Is the "(dirname(__FILE__).'/../../modules/'.$this->name.'/" path absolute or I have to edit it?I've put the mails folder in the main one: mymodule/mails. Link to comment Share on other sites More sharing options...
El Patron Posted March 24, 2014 Share Posted March 24, 2014 Is the "(dirname(__FILE__).'/../../modules/'.$this->name.'/" path absolute or I have to edit it? I've put the mails folder in the main one: mymodule/mails. in the example I gave my module has mails in copymails. You would need to change this to match where in your module folder the mail templates are located. Link to comment Share on other sites More sharing options...
Rain_xx Posted March 24, 2014 Author Share Posted March 24, 2014 (edited) in the example I gave my module has mails in copymails. You would need to change this to match where in your module folder the mail templates are located. of course. but I'm asking about the path that regards the bold part: copy(dirname(__FILE__).'/../../modules/'.$this->name.'/copymails/en/filename.html' Edited March 24, 2014 by Rain_xx (see edit history) Link to comment Share on other sites More sharing options...
El Patron Posted March 24, 2014 Share Posted March 24, 2014 of course. but I'm asking about the path that regards the bold part: copy(dirname(__FILE__).'/../../modules/'.$this->name.'/copymails/en/filename.html' do exactly like that..works for me Link to comment Share on other sites More sharing options...
Rain_xx Posted March 25, 2014 Author Share Posted March 25, 2014 Really thank you Link to comment Share on other sites More sharing options...
El Patron Posted March 25, 2014 Share Posted March 25, 2014 Really thank you with pleasure, happy developing 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