On line 104 of the relang.module file there is an array named $user_mail_actions that is set to a list of strings beginning with 'user_'. Then, the following condition is tested:
if (in_array($message['id'], $user_mail_actions)
However, the logintoboggan module uses strings that begin with 'logintoboggan_' and not 'user_' so this condition will never evaluate to true.
Comments
Comment #1
kars-t commentedComment #2
kars-t commentedThe Problem is I can't enter all possible emails to the array I use in the module. I have added an option to force a language setting to all emails but can't test it now. Maybe another solution would be to alter the mailedit module so it forces the language for emails if a user is set. I will contact the modules admin about this. Next release probably tommorow.
Thanks for the input and logintoboggan is a great module I will you from now ;)
Comment #3
2c commentedIf you create the $user_mail_actions array like following:
You could then change line 113 to something like this:
if (in_array(explode('_',$message['id'], 1), $user_mail_actions) && $message['params']['account']->language)In the previous code example, the part explode('_',$message['id'], 1) is where I've made changes.
PHP explode function: http://www.tizag.com/phpT/php-string-explode.php
Comment #4
kars-t commentedI did a different approach:
If a user object is set in the emails data array and you set reglang to use the preferred language it will be set. By this I believe I set any user releated mails to the language you desire :)
I did test it with the logintoboggan module activated.
Fixed in 6.x-1.5
Comment #5
2c commentedThere's a further complication that may not be due to this module, but I'll post it here in case it helps somebody experiencing problems with the LoginToBoggan module.
Around line 387 of the mail_edit.module and about 4 lines into the mail_edit_mail_alter function there's some code that reads:
$result = db_query($query, $mail['id']);This query is made against the mail_edit_registry database table. The value of $mail['id'] will be prefixed with 'logintoboggan_', however the values in the database are prefixed with 'user_'.
I expect this is a mail_edit/logintoggan issue.
Comment #6
kars-t commented@phonydream2
This is a problem of mail_edit module and how it discovers the emails to alter. Right now I did take a look at it and can't see how this really is done. hook_mailkeys seems todo nothing for me. Maybe open an issue in the mailedit queue?
Comment #8
rfayThis is a very worth problem to solve, as Logintoboggan is a key module for many sites.
+1 on this!
Comment #9
rfay@Kars-T: I apologize. It's mail_edit that is the problem. It can't support logintoboggan in its current form because everything is wired to the mailkeys with "user_" prepended to them.
Comment #10
rfayMail_edit doesn't currently support anything coming from logintoboggan. This patch in the mail_edit issue queue deals with this.