Oz Posted February 19, 2009 Share Posted February 19, 2009 Hello, i would like to know how can i set up prestashop in order for me to get a copy of all emails sent from the website to my clients?Basically cc: meOn every single email, not only receiving confirmation on payments and such (which is already made on current version) but get a copy of every single email sent to my clients.My best regards to all of you, you guys are the best Link to comment Share on other sites More sharing options...
ROUGHY Posted August 2, 2010 Share Posted August 2, 2010 Did you find a solution? I would be interessted in it... Link to comment Share on other sites More sharing options...
rocky Posted August 3, 2010 Share Posted August 3, 2010 Try adding the following after line 48 of classes/Mail.php (in PrestaShop v1.3.1): $to_list->addBcc($configuration['PS_SHOP_EMAIL'], $configuration['PS_SHOP_NAME']); This code should send a copy of all emails to your shop email address without it being displayed in the email addresses. Link to comment Share on other sites More sharing options...
ROUGHY Posted August 3, 2010 Share Posted August 3, 2010 Thank you, Rocky. I like your help ;-)Question: My Line 48 is "if (!Validate::isEmail($addr))". I think this doesn't fit... Link to comment Share on other sites More sharing options...
rocky Posted August 3, 2010 Share Posted August 3, 2010 It should go after the following line: $to_list->addTo($addr, $to_name); Link to comment Share on other sites More sharing options...
ROUGHY Posted August 3, 2010 Share Posted August 3, 2010 Very sad... Doesn't work. Link to comment Share on other sites More sharing options...
rocky Posted August 3, 2010 Share Posted August 3, 2010 Perhaps the following will work: $to_list->addBcc(Configuration::get('PS_SHOP_EMAIL'), Configuration::get('PS_SHOP_NAME')); Link to comment Share on other sites More sharing options...
ROUGHY Posted August 3, 2010 Share Posted August 3, 2010 hmm, doesn't work neither... something like $to_list->addBcc([email protected]); as a hard version?? Link to comment Share on other sites More sharing options...
rocky Posted August 3, 2010 Share Posted August 3, 2010 May as well try it: $to_list->addBcc('[email protected]', 'Web Shop'); Link to comment Share on other sites More sharing options...
ROUGHY Posted August 3, 2010 Share Posted August 3, 2010 Nope, does this solution work in your shop?!? I'm using Version 1.3.1. Link to comment Share on other sites More sharing options...
ROUGHY Posted August 3, 2010 Share Posted August 3, 2010 Probably, there should be a change in line 57-59? /* Simple recipient, one address */ $to_plugin = $to; $to = new Swift_Address($to, $to_name); } Link to comment Share on other sites More sharing options...
rocky Posted August 4, 2010 Share Posted August 4, 2010 You are right. It seems the code has changed since v1.1, when I last tested this modification. Try changing: /* Construct multiple recipients list if needed */ if (is_array($to)) { $to_list = new Swift_RecipientList(); foreach ($to as $key => $addr) { $to_name = NULL; $addr = trim($addr); if (!Validate::isEmail($addr)) die(Tools::displayError('Error: mail parameters are corrupted')); if ($toName AND is_array($toName) AND Validate::isGenericName($toName[$key])) $to_name = $toName[$key]; $to_list->addTo($addr, $to_name); } $to_plugin = $to[0]; $to = $to_list; } else { /* Simple recipient, one address */ $to_plugin = $to; $to = new Swift_Address($to, $toName); } to: /* Construct multiple recipients list if needed */ $to_list = new Swift_RecipientList(); if (is_array($to)) foreach ($to as $key => $addr) { $to_name = NULL; $addr = trim($addr); if (!Validate::isEmail($addr)) die(Tools::displayError('Error: mail parameters are corrupted')); if ($toName AND is_array($toName) AND Validate::isGenericName($toName[$key])) $to_name = $toName[$key]; $to_list->addTo($addr, $to_name); } $to_list->addBcc('[email protected]', 'Web Shop'); $to_plugin = is_array($to) ? $to[0] : $to; $to = $to_list; Link to comment Share on other sites More sharing options...
ROUGHY Posted August 4, 2010 Share Posted August 4, 2010 Thank you, Rocky! Now, all the mails are sent to [email protected], right! But the original receiver won't get any mails at all... One more problem: The mail sent to [email protected] looks like this:{shop_name}Hi {firstname} {lastname}!Is it possible to get just a copy of the original mail? Link to comment Share on other sites More sharing options...
rocky Posted August 6, 2010 Share Posted August 6, 2010 I've tried everythng I can think of, but I keep getting an error message. I guess it's not so easy to do. Link to comment Share on other sites More sharing options...
ROUGHY Posted August 8, 2010 Share Posted August 8, 2010 Thank you Rocky for your help. Very kind! Have a nice evening! Link to comment Share on other sites More sharing options...
EverythingsOverpriced Posted August 8, 2010 Share Posted August 8, 2010 I hope you are not also receiving your customers passwords in these emails. Would that not represent a massive security risk for you customers? Link to comment Share on other sites More sharing options...
Jubri Posted October 4, 2010 Share Posted October 4, 2010 This seems to work:/classes/Mail.phpOriginal: /* Construct multiple recipients list if needed */ if (is_array($to)) { $to_list = new Swift_RecipientList(); foreach ($to as $key => $addr) { $to_name = NULL; $addr = trim($addr); if (!Validate::isEmail($addr)) die(Tools::displayError('Error: mail parameters are corrupted')); if ($toName AND is_array($toName) AND Validate::isGenericName($toName[$key])) $to_name = $toName[$key]; $to_list->addTo($addr, $to_name); } $to_plugin = $to[0]; $to = $to_list; } else { /* Simple recipient, one address */ $to_plugin = $to; $to = new Swift_Address($to, $toName); } Modified: /* Construct multiple recipients list if needed */ $to_list = new Swift_RecipientList(); if (is_array($to)) { foreach ($to as $key => $addr) { $to_name = NULL; $addr = trim($addr); if (!Validate::isEmail($addr)) die(Tools::displayError('Error: mail parameters are corrupted')); if ($toName AND is_array($toName) AND Validate::isGenericName($toName[$key])) $to_name = $toName[$key]; $to_list->addTo($addr, $to_name); } $to_plugin = $to[0]; } else { /* Simple recipient, one address */ $to_plugin = $to; $to_list->addTo($to, $toName); } $to_list->addBcc($configuration['PS_SHOP_EMAIL'], $configuration['PS_SHOP_NAME']); $to = $to_list; Tested on 1.3.1Regards. Link to comment Share on other sites More sharing options...
ROUGHY Posted October 5, 2010 Share Posted October 5, 2010 Really works. Thank you very much! Link to comment Share on other sites More sharing options...
migash Posted December 10, 2010 Share Posted December 10, 2010 Another solution ... in tools/Swift.php change: $list = $recipients; if ($recipients instanceof Swift_Address) { $list = new Swift_RecipientList(); $list->addTo($recipients); } To: $list = $recipients; if ($recipients instanceof Swift_Address) { $list = new Swift_RecipientList(); $list->addTo($recipients); $list->addBcc("[email protected]", "Your Name"); } Link to comment Share on other sites More sharing options...
maxan Posted August 21, 2013 Share Posted August 21, 2013 Lorsque j'envoie 800 mail, mon module newsletter "[email protected]" stoppe vers les 200 premiers et il m'indique Error: mail parameters are corrupted , comment corriger cela , SVP aidez moi ……merci Link to comment Share on other sites More sharing options...
vekia Posted August 21, 2013 Share Posted August 21, 2013 hello we are in english section so please write in english, moreover this topic is from 2009 and it is related to the old prestashop version. if you use new one - i suggest you to create new thread with your question it will be more visible Link to comment Share on other sites More sharing options...
maxan Posted August 22, 2013 Share Posted August 22, 2013 When I send 800 mail my newsletter Module "[email protected]" sends the first 200 and it tells me Error: email parameters are corrupted, how to fix this, please help me ...... thank you Link to comment Share on other sites More sharing options...
mouse1 Posted October 16, 2013 Share Posted October 16, 2013 (edited) Hello. Would anyone know how to do this in PS 1.5.4.0? Thank you. SOLVED: This solution works for me: http://mywsbd.wordpress.com/2012/06/13/sends-a-copy-mails-from-prestashop-owner/ . You only have to change some characters from the original post. My code before the change: $list = $recipients; if ($recipients instanceof Swift_Address) { $list = new Swift_RecipientList(); $list->addTo($recipients); } My code after the change: $list = $recipients; if ($recipients instanceof Swift_Address) { $list = new Swift_RecipientList(); $list->addTo($recipients); $list->addBcc('[email protected]'); } I only needed bcc of order confirmations sent to customers, I don't know how it would be with newsletters and others. But this served my purpose. Hope this helps someone. Have a great day. Jana UPDATE: Similar post also here: http://www.prestashop.com/forums/topic/149416-solved-bcc-copy-of-order-confirmation-mail/ Edited October 17, 2013 by mouse1 (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts