I discovered this flaw in the mimemail module when working with send module in a multilingual site.
In the mimemail.module the function mimemail_html_body() gets called which you ll find in the mimemail.inc file.
Here in the preg_replace _mimemail_url() gets called which will format all your urls in the mail.
But what happens is that the when you have a node http://yoursite.com/fr/node/7 the url gets transformed to http://yoursite.com/fr/fr/node/7
Quick fix: Patch the module and put on line 518 before the url() function:
$languages = array('nl', 'fr', 'de');//all languages
foreach ($languages as $lang) {
$path = str_replace($lang, '', $path);
}
Real fix:
Multilingual support in the mimemail module. Should be taken into account where the replace gets called on line 300 in mimemail.inc
Comments
Comment #1
rescandon CreditAttribution: rescandon commentedthank you for this quick patch
I had the same problem with a multilingual site and i tested the quick solution with small change
$languages = array('es/', 'en/');//all languages
foreach ($languages as $lang) {
$path = str_replace($lang, '', $path);
}
because without the "/" the patch replace others words in the path like "destination" by "dtination"
thanks
Comment #2
Hobbes-2 CreditAttribution: Hobbes-2 commentedSame problem here with 6.x-1.0-alpha2
/fr/fr , /en/en in email
Comment #3
sgabe CreditAttribution: sgabe commentedDuplicate of #417462: Language prefix is not taken into account.
Comment #4
llribas CreditAttribution: llribas commentedthis is still a problem with this module.
I improved a little bit more this quick patch. With this last version still causes conflicts, for example:
es/es/novedades/node21
become a broken url:
es/novedad/node21
my quick solution with regexp (it only removes lang code at the begining of the url):
$path = preg_replace('/^ca\/|^es\//', '', $path);
Comment #5
sgabe CreditAttribution: sgabe commentedThis issue is a duplicate. Please post your thoughts and findings in the original issue here: #417462: Language prefix is not taken into account