--- simplenews_template.module	2008-12-05 13:41:22.000000000 +0000
+++ simplenews_template.module	2009-01-21 16:07:30.197866500 +0000
@@ -13,7 +13,7 @@
  *
  * Sponsors:
  *   Spoon Media <http://www.spoon.com.au/>
- *   Webbredaktören <http://www.webbredaktoren.se>
+ *   Webbredaktoren <http://www.webbredaktoren.se>
  */
 
 
@@ -32,9 +32,13 @@
  * Implementation of hook_mail_alter.
  */
 function simplenews_template_mail_alter(&$message) {
+  static $processed;
   $function = "_simplenews_template_mail_alter_{$message['id']}";
   if (function_exists($function)) {
     $function($message);
+  } else if (!$processed) {
+    _simplenews_template_mail_alter_simplenews_node($message);
+    $processed = TRUE;
   }
 }
 
@@ -84,7 +88,12 @@
  */
 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;
+  }
+  
   $newsletter = taxonomy_get_term($tid);
   $node = $message['params']['context']['node'];
   $content = $message['body']['body'];
@@ -367,8 +376,8 @@
 /**
  * Hi-jacker to stop the title from being inserted above the HTML in the mail.
  */
-function _simplenews_template_theme_simplenews_newsletter_body($body, $title, $language) {
-  return $body;
+function _simplenews_template_theme_simplenews_newsletter_body($node, $language) {
+    return drupal_render($node->content);
 }
 
 /**
