vincimusic Posted June 1, 2012 Share Posted June 1, 2012 1.4.7.0 when an identified customer with a valid email adress orders on my online shop http://vincimusic.net, he receives an order confirmation email. the recipient label of this email is not the created email adress or the customer name, but a strange "coded ?" label like : aGVsaW9zIHN1bmVy I don't know where and why this label is generated, and I think that the customer will not feel confident when he receives an email labelled like that. Is there a way to generate a more "normal" recipient name like the customer name, or his email adress Thanks for your help Link to comment Share on other sites More sharing options...
codegrunt Posted June 1, 2012 Share Posted June 1, 2012 I am not sure if this is different in 1.4.7 but in 1.4.8.2 the PaymentModule::validateOrder() method sends the confirmation message like this: if (Validate::isEmail($customer->email)) Mail::Send((int)$order->id_lang, 'order_conf', Mail::l('Order confirmation', (int)$order->id_lang), $data, $customer->email, $customer->firstname.' '.$customer->lastname, NULL, NULL, $fileAttachment); The MailCore::Send() method looks like this: public static function Send($id_lang, $template, $subject, $templateVars, $to, $toName = null, $from = null, $fromName = null, $fileAttachment = null, $modeSMTP = null, $templatePath = _PS_MAIL_DIR_, $die = false) So the "fromName" should look something like "Klaus Kinski" (i.e. first name space last name). I would start by taking a look at the customer in the back office and make sure the name field looks OK there. If the name looks OK in the backoffice then maybe the paymentModule class has been modified (or overridden) to change this? Take a look at "classes/PaymentModule.php" and make sure that the the above method has not been modified to do something else with the "fromName" argument. Does this happen with all payment modules or just one? Does it happen with other mails sent out by Prestashop or just the order confirmations? Cheers Link to comment Share on other sites More sharing options...
vincimusic Posted June 2, 2012 Author Share Posted June 2, 2012 Hi Codegrunt, thanks for your help. The customer name field is OK. The payment module is OK (correct firstname and lastname fields) I've tried 3 different payment modes, and the email recipient name is always the same (for example : aGVsaW9zIHN1bmVy) I've sent an email from the back office related to a previous order, and I get the same recipient strange name. I've sent an email from the back office to the customer thru "after sales service" and the recipient name appears correctly : firstname lastname. So I'm not sure if the problem is related to the payment module, but it appears that non-orders related emails work fine, and order related emails (being a payment, or a back office sent email related to a previous order) get a recipient strange name. The strange name is always the same for the same customer, and different between custormers. Its lenght can vary from 3 to 16 Hope this helps to analyse the problem Regards Link to comment Share on other sites More sharing options...
codegrunt Posted June 2, 2012 Share Posted June 2, 2012 Did you check for a class override (overrides/classes or overrides/controllers) that might be changing how the email is sent (i.e. be passing an argument to the mail system out of order)? If you cannot find anything like that I would start by adding some debug statements that write to a file (since you normally would get redirected during payment so would not see the message) showing what was passed to the mail function in PaymentModule::validateOrder(). This will help sort out whether this is happening before or after that method is called. If it is after, the problem is probably happening in Swift somewhere. If before, then it is matter of looking at how the customer object is loaded. Strange issue! Cheers Link to comment Share on other sites More sharing options...
vincimusic Posted June 4, 2012 Author Share Posted June 4, 2012 Hi I've got another reply on the forge forum PSCFI-5810 that solved the problem. It consists in changing the classes/Mail.php file by the latest one located : http://svn.prestashop.com/trunk/classes/Mail.php It works fine Regards 1 Link to comment Share on other sites More sharing options...
Recommended Posts