Miguel F Posted February 2, 2015 Share Posted February 2, 2015 (edited) Somebody know how to change the email template the user receives if the user is logged or not? Edited February 2, 2015 by Miguel F (see edit history) Link to comment Share on other sites More sharing options...
Radu Posted February 2, 2015 Share Posted February 2, 2015 You can override the Mail class and in this way you have controll of all the emails that are sent through presta class Mail extends MailCore { public static function Send($id_lang, $template, $subject, $template_vars, $to, $to_name = null, $from = null, $from_name = null, $file_attachment = null, $mode_smtp = null, $template_path = _PS_MAIL_DIR_, $die = false, $id_shop = null) { switch ($template) { // do whatever you wish } } } Link to comment Share on other sites More sharing options...
Miguel F Posted February 2, 2015 Author Share Posted February 2, 2015 Thanks for the answer. But i have another question. Whats the best way to check if the user is logged in the mail.php? Because i tried many ways to do but doesnt seems to work properly Link to comment Share on other sites More sharing options...
Radu Posted February 3, 2015 Share Posted February 3, 2015 I am not able to check now the code but try Context::getContext()->customer->id Link to comment Share on other sites More sharing options...
Miguel F Posted February 4, 2015 Author Share Posted February 4, 2015 Thank you! Finally i made it checking if the user it's a guest instead of check if its logged. Big thanks anyway 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