jimlarsson Posted February 1, 2012 Share Posted February 1, 2012 Hi, I need to send different email templates depending on the product that has been purchased. They should be sent automatically after purchase, in addition to those that are sent by default. I also need to define additional email addresses where each of these emails are sent. Is there a way to do it? Any idea highly appreciated. Thanks in advance! Link to comment Share on other sites More sharing options...
makethisworkout Posted February 1, 2012 Share Posted February 1, 2012 hi, if you find out i'd love to know too, thanks, Jon Link to comment Share on other sites More sharing options...
sebkos Posted February 1, 2012 Share Posted February 1, 2012 Hi, could you give some more info, some example of mail template? What difference in templates do you expect? What should determine those differences product ID, product category, manufacturer? Link to comment Share on other sites More sharing options...
jimlarsson Posted February 2, 2012 Author Share Posted February 2, 2012 Hi, could you give some more info, some example of mail template? What difference in templates do you expect? What should determine those differences product ID, product category, manufacturer? Hi, I sell activities and events, not physical products, and there are some details about the activity that are provided to the costumer only after purchase (e.g. contact name, telephone number...), so differences in templates should be determined by product ID. Differences in templates would only affect text content. As a provisional solution I will create downloadable products and include this "post-purchase information" in a downloadable PDF, but that's one more step and many clicks for customers, and I'd like to make the process easier for them. Just as better as an automatic specific email template for each product (or even better, to avoid information duplication) could be to automatically email customers the same PDF that can be downloaded from their account. Is there a way to do so? Thanks! Link to comment Share on other sites More sharing options...
sebkos Posted February 2, 2012 Share Posted February 2, 2012 Hi, I haven't got ready solution, but I think you could go this way: - add mentioned information (e.g. contact name, telephone number...) as product features - make visible or hidden features on product page as you want - change mail function in class PaymentModule.php which is responsible for preparation data and sending "order confirmation" e-mail - change order_conf.html and order_conf.txt templates to display needed information Link to comment Share on other sites More sharing options...
jimlarsson Posted February 2, 2012 Author Share Posted February 2, 2012 Hi, I haven't got ready solution, but I think you could go this way: - add mentioned information (e.g. contact name, telephone number...) as product features - make visible or hidden features on product page as you want - change mail function in class PaymentModule.php which is responsible for preparation data and sending "order confirmation" e-mail - change order_conf.html and order_conf.txt templates to display needed information Thanks, sekbos! Is sounds good, and I think it could work for me. However, I'm not a programmer, and when I look at the code of PaymentModule.php, I just don't know which lines should I edit... Any suggestion? Link to comment Share on other sites More sharing options...
sebkos Posted February 3, 2012 Share Posted February 3, 2012 I've got it! rename your file PaymentModule.php and paste attached file in the same place. You have to make some modifications in mail template but if you make sample order and receive order confirmation mail you will know what to do. Let me know if it works. PaymentModule.php Link to comment Share on other sites More sharing options...
jimlarsson Posted February 3, 2012 Author Share Posted February 3, 2012 Hi, Your solution works just fine. Yes, I have to edit the email template, but I think I can deal with that. Thank you so much! Link to comment Share on other sites More sharing options...
SatishMasani Posted February 11, 2016 Share Posted February 11, 2016 This helped me to . Link to comment Share on other sites More sharing options...
TurkeyFish Posted May 30, 2017 Share Posted May 30, 2017 I'm in a similar situation and want to send one of many possible follow-up emails to customers after they purchase certain products. It is regarding maintenance/care of certain equipment and will drive them to my blog. I don't think the above solution with the paymentmodule file would work for me, since I need to include multiple paragraphs of text, and make sure to only send one email, delay the email to send 8 days after purchase, and avoid sending a given email to the same customer again. If no module is available that is made to do customer follow ups like this, I might be into hiring a developer to create it. Feel free to PM me. Link to comment Share on other sites More sharing options...
vanhims Posted May 30, 2017 Share Posted May 30, 2017 Hi, I have made a module for this. Exactly like you are looking for. What you do is this: Create a new module. See PRestashop module generator to get a ready to use module In the install() function of your <modulename>.php. Add this hook: $this->registerHook('actionValidateOrder'); Then create in the same .php file a new function called: public function hookActionValidateOrder($params){}; This hook is triggered automatically after an order is submitted. If you do this: print_r($params); inside this action hook, you get a nice array with all the available options like customer email, order data, etc.Then when this hook is triggered you can setup a mail function to send the mail in any template to any person you want. 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