Index: og_mandatory_group.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/og_mandatory_group/og_mandatory_group.module,v retrieving revision 1.11 diff -u -p -r1.11 og_mandatory_group.module --- og_mandatory_group.module 5 Sep 2008 01:22:36 -0000 1.11 +++ og_mandatory_group.module 5 Sep 2008 21:47:55 -0000 @@ -116,7 +116,9 @@ function og_mandatory_group_user($op, &$ if (user_access('administer users', user_load(array('uid' => $row->uid)))) { $body .= "\n". t('You may manage this user at @url', array('@url' => url("user/$account->uid/edit", array('absolute' => TRUE)))); } - drupal_mail('og_mandatory_group_register', 'notify', $row->mail, $subj, $body, $from); + // array of params with the context so the message will be sent properly + $params = array('context' => array('subject' => $subj, 'body' => $body)); + drupal_mail('og_mandatory_group', 'notify', $row->mail, language_default(), $params, $from); } } } @@ -125,6 +127,15 @@ function og_mandatory_group_user($op, &$ } /** + * Implementation of hook_mail() + */ +function og_mandatory_group_mail($key, &$message, $params) { + $context = $params['context']; + $message['subject'] = str_replace(array("\r", "\n"), '', $context['subject']); + $message['body'] = drupal_html_to_text($context['body']); +} + +/** * Implementation of hook_menu * */