Index: og2list.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/og2list/og2list.module,v
retrieving revision 1.109
diff -u -r1.109 og2list.module
--- og2list.module	5 Aug 2007 12:35:31 -0000	1.109
+++ og2list.module	1 Nov 2007 06:49:21 -0000
@@ -541,7 +541,7 @@
     $node = node_load($og);
     $subject = $node->og2list_subject_prefix .' '. $subject;
     $mid = db_next_id("{og2list_outgoing_content}_mid");
-    db_query("INSERT INTO {og2list_outgoing_content} (mid, to_name, to_address, from_name, from_address, subject, msgid, body, is_node, id) VALUES (%d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d)", $mid, $edit['ogs'][$og]['name'], $edit['ogs'][$og]['address'], $edit['name'], $edit['mail'], $subject, $msg_id, "<html><body>$body</body></html>", $edit['cid'] ? 0 : 1, $edit['cid'] ? $edit['cid'] : $edit['nid']);
+    db_query("INSERT INTO {og2list_outgoing_content} (mid, to_name, to_address, from_name, from_address, subject, msgid, body, is_node, id) VALUES (%d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d)", $mid, $edit['ogs'][$og]['name'], $edit['ogs'][$og]['address'], $edit['name'], $edit['mail'], $subject, $msg_id, "" /* this field is empty for now but can later contain a group footer */, $edit['cid'] ? 0 : 1, $edit['cid'] ? $edit['cid'] : $edit['nid']);
    
     // see og2list.install for status codes
     $result = db_query('INSERT INTO {og2list_outgoing_arguments} (mid, nid, timestamp, status, uid) VALUES (%d, %d, %d, %d, %d)', $mid, $og, time(), $node->og2list_ml_status ? (($node->og2list_ml_moderate || ($status == 0)) ? OG2LIST_OUTGOING_MODERATED : OG2LIST_OUTGOING_NOT_SENT) : OG2LIST_OUTGOING_POSTPONED, $account->uid);

Index: mail-out.pl
===================================================================
RCS file: /cvs/drupal/contributions/modules/og2list/mail-out.pl,v
retrieving revision 1.37
diff -u -r1.37 mail-out.pl
--- mail-out.pl	3 Nov 2006 08:39:15 -0000	1.37
+++ mail-out.pl	1 Nov 2007 06:49:21 -0000
@@ -90,7 +90,7 @@
    $do_digest
 
    $mid $nid $from_name $from_address $to_name $to_address
-   $subject $message_id $content_type $body
+   $subject $message_id $content_type $body $footer
    %digest_msgs
 );
 
@@ -136,11 +136,14 @@
                 c.subject,
                 c.msgid,
                 c.content_type,
+                nr.body,
                 c.body,
                 r.nid
-FROM og2list_outgoing_recipients AS r,
-     og2list_outgoing_content AS c
-WHERE (r.mid = c.mid) AND (r.status = ?)
+FROM og2list_outgoing_recipients AS r
+	INNER JOIN og2list_outgoing_content AS c ON r.mid = c.mid
+	INNER JOIN node AS n ON c.id = n.nid
+	INNER JOIN node_revisions AS nr ON n.nid = nr.nid AND n.vid = nr.vid
+WHERE (r.status = ?)
 EOF
 
 $get_arg_stmt =<<EOF;
@@ -288,7 +291,7 @@
 if ($do_digest) {
   $get_content_handle->execute(OG2LIST_OUTGOING_DIGEST);
   while ( ($mid, $from_name, $from_address, $to_name, $to_address,
-	   $subject, $message_id, $content_type, $body, $nid) =
+	   $subject, $message_id, $content_type, $body, $footer, $nid) =
 	  $get_content_handle->fetchrow_array() ) {
     # Build an entry ($nid) in %digest_msgs for every ogroup and add
     # the digest message
@@ -376,7 +379,7 @@
 } else {
   $get_content_handle->execute(1);
   while ( ($mid, $from_name, $from_address, $to_name, $to_address,
-	   $subject, $message_id, $content_type, $body, $nid) =
+	   $subject, $message_id, $content_type, $body, $footer, $nid) =
 	  $get_content_handle->fetchrow_array() ) {
     my $msg = MIME::Entity->build
       ("From"       => "$from_name <$from_address>",
@@ -386,7 +389,7 @@
        "Encoding"   => "-SUGGEST",
        "Charset"    => "utf-8",
        "Message-ID" => "$message_id",
-       "Data"       => "$body",
+       "Data"       => "<html><body>$body$footer</body></html>",
        "X-Mailer"   => undef);
     if ($set_reply_to != 0) {
       $msg->head()->add('Reply-To', "<$to_address\@$mail_domain>");
