Dominique De Cooman
Published on Dominique De Cooman (https://dominiquedecooman.com)

Home > Mime mail module and multilingual support

Dominique De Cooman
Wednesday, March 25, 2009 - 21:59
mail [1]
multilingual [2]
send [3]

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 [4] the url gets transformed to http://yoursite.com/fr/fr/node/7 [5]
Quick fix: Patch the module and put on line 518 before the url() function:

<?php
$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
http://drupal.org/node/446000 [6]


Source URL: https://dominiquedecooman.com/blog/mime-mail-module-and-multilingual-support

Links
[1] https://dominiquedecooman.com/blog-topics/mail
[2] https://dominiquedecooman.com/blog-topics/multilingual
[3] https://dominiquedecooman.com/blog-topics/send
[4] http://yoursite.com/fr/node/7
[5] http://yoursite.com/fr/fr/node/7
[6] http://drupal.org/node/446000