Jump to content

Odd email characters


Recommended Posts

How did you fix the characters?  I am having the same problem.

To remove characters in subject field go to Localization>Translations>Modify translations,  select Email templates translation and pick your theme. Click on a language flag after that and look which template has characters you want to delete.

Link to comment
Share on other sites

  • 2 weeks later...

Is anyone still following this thread?

 

Summary: Will removing the contact ID and contact token from the subject break message thread tracking? Are any of the developers at PrestaShop open to discuss a different way to do this (not in the subject)?

 

Details:

 

I know how to get rid of these "ugly" characters (which I believe are a contact ID and contact token), but I still have some questions and a few, hopefully constructive, comments.

 

I don't want to introduce unexpected side effects by changing the behavior. Is this information required in the subject to track message threads? If so, why is the same information needed in the subject when the preferred way to respond to the message is by clicking the supplied link which has the same information in the URL? Will I break message thread tracking if I remove the information from the subject? Is there a way to do this globally or to find all messages with this behavior? I found 2 messages so far with the problem and there are probably others. Using trial and error to find them all does not seem like a good way to go.

 

There was an issue reported about this (http://forge.prestashop.com/browse/PSCFV-8736) and it has been marked "resolved". However, it still appears in latest PrestaShop 1.5.6. The discussion in the issue implies that this is by design. I find it surprising that someone making design decisions at PrestaShop actually thinks this is acceptable. Besides being downright ugly and unprofessional, it looks like there is a problem with the website. When I see something like this on a vendor's site, I lose confidence in doing business on their site (it raises security questions in my mind). Frankly, it's not a face I want to present on my own site.

 

Anyone want to discuss it further?

Link to comment
Share on other sites

Concerning the second issue discussed here (the email "from" name is 'u'). I discovered what appears to be a bug in the code in AdminCustomerThreadsController.php. An object of type Controller is instantiated based on an id_contact and id_language. It seems like the id_language was intended to select the contact name from an array, indexed by id_language (probably for localization of the name). The line in the code that does this contains the following statement: "$from_name = $contact->name[(int)$ct->id_lang];".

 

It is $from_name that ends up containing "u". I did some digging and found that $contact->name is a string containing "Customer service", not an array of strings, and because $ct->id_lang contains "1", when the above statement is executed it assigns the second character of "Customer service" (or "u") to $from_name, and this is used in the email. I could not find the definition of class Contact, so I could not determine anything about how $contact->name gets populated.

 

I don't know a lot about PHP (so I may be way off base), but I did research and found that PHP does indeed treat a string as an array, so that accessing a string using $string[n] gives the nth character of the string.

 

Since I'm also new to PrestaShop I'd like an opinion as to whether this is really a bug (the bug might really be in the code that populates $contact->name, inserting a string instead of an array). If this indeed looks like a bug how do I report it?

Link to comment
Share on other sites

  • 1 month later...
  • 3 weeks later...

Concerning the second issue discussed here (the email "from" name is 'u'). I discovered what appears to be a bug in the code in AdminCustomerThreadsController.php. An object of type Controller is instantiated based on an id_contact and id_language. It seems like the id_language was intended to select the contact name from an array, indexed by id_language (probably for localization of the name). The line in the code that does this contains the following statement: "$from_name = $contact->name[(int)$ct->id_lang];".

 

It is $from_name that ends up containing "u". I did some digging and found that $contact->name is a string containing "Customer service", not an array of strings, and because $ct->id_lang contains "1", when the above statement is executed it assigns the second character of "Customer service" (or "u") to $from_name, and this is used in the email. I could not find the definition of class Contact, so I could not determine anything about how $contact->name gets populated.

 

I don't know a lot about PHP (so I may be way off base), but I did research and found that PHP does indeed treat a string as an array, so that accessing a string using $string[n] gives the nth character of the string.

 

Since I'm also new to PrestaShop I'd like an opinion as to whether this is really a bug (the bug might really be in the code that populates $contact->name, inserting a string instead of an array). If this indeed looks like a bug how do I report it?

 

I know this is an old topic, but MisterPresta pointed me in the right direction.

Until this is fixed, edit the file "AdminCustomerThreadsCOntroller.php" line 407.

Change:

$from_name = $contact->name[(int)$ct->id_lang];

To:

$from_name = $contact->name; //[(int)$ct->id_lang]; commented out just in case.

Should fix it.

Link to comment
Share on other sites

  • 6 months later...
×
×
  • Create New...