--- simplenews_template.module.orig 2010-06-16 17:50:32.000000000 +0200 +++ simplenews_template.module 2010-06-16 17:52:12.000000000 +0200 @@ -100,17 +100,19 @@ function simplenews_template_form_alter( */ function _simplenews_template_mail_alter_simplenews_node(&$message) { // Setup newsletter data - $tid = reset($message['params']['context']['account']->tids); - if (!empty($message['params']['context']['account']->tids)) { - $tid = reset($message['params']['context']['account']->tids); - } else { - $tid = $message['params']['context']['newsletter']->tid; - } + $taxonomy = $message['params']['context']['node']->taxonomy; + $vid = variable_get('simplenews_vid', ''); + foreach($taxonomy as $term){ + if($term->vid == $vid){ + $newsletter = $term; + $tid = $term->tid; + break; + } + } - $newsletter = taxonomy_get_term($tid); $node = $message['params']['context']['node']; $content = $message['body']['body']; - + // Tokenize the header and footer: find the tokens global $language, $user; $context['node'] = $node;