diff --git a/plugins/notifier/abstract.inc b/plugins/notifier/abstract.inc
index 5418db7..79409c2 100644
--- a/plugins/notifier/abstract.inc
+++ b/plugins/notifier/abstract.inc
@@ -20,14 +20,21 @@ class MessageDigest extends MessageNotifierBase {
       'sent' => FALSE,
       'timestamp' => $message->timestamp,
     );
+    // This will only have a value if the message is not a message_subscribe
+    // message.
+    $mid = $message->mid;
 
     // Our $message is a cloned copy of the original $message with the mid field removed to
     // prevent overwriting (this happens in message_subscribe) so we need to fetch the mid manually.
-    $mid = db_select('message', 'm')
-      ->fields('m', array('mid'))
-      ->condition('timestamp', $message->timestamp)
-      ->execute()
-      ->fetchField();
+    if (empty($mid)) {
+      $mid = db_select('message', 'm')
+        ->fields('m', array('mid'))
+        ->condition('timestamp', $message->timestamp)
+        ->condition('type', $message->type)
+        ->execute()
+        ->fetchField();
+     }
+
     if (!empty($mid)) {
       $message_digest['mid'] = $mid;
     }
