--- a/sites/all/modules/uc_invite_discount/uc_invite_discount.module
+++ b/sites/all/modules/uc_invite_discount/uc_invite_discount.module
@@ -458,7 +458,7 @@
                                     $body = token_replace_multiple($body, $token_filters);
                                     $body = token_replace_multiple($body, $token_filters);
 
-                                    drupal_mail($key, $to, $subject, $body, $from);
+                                    drupal_mail('uc_invite_discount', 'coupon_created', $to, user_preferred_language(user_load(array('mail' => $to))), array('subject' => $subject, 'body' => $body), $from);
                                 }
 
                                 if(variable_get('uc_invite_discount_invitor_notify_setting',TRUE))
@@ -474,7 +474,7 @@
                                     $body = token_replace_multiple($body, $token_filters);
                                     $body = token_replace_multiple($body, $token_filters);
 
-                                    drupal_mail($key, $to, $subject, $body, $from);
+                                    drupal_mail('uc_invite_discount', 'coupon_created', $to, user_preferred_language(user_load(array('mail' => $to))), array('subject' => $subject, 'body' => $body), $from);
                                 }
                             }
                             else
@@ -490,6 +490,18 @@
 }
 
 /**
+ * Implementation of hook_mail().
+ */
+function uc_invite_discount_mail($key, &$message, $params) {
+    switch ($key) {
+        case 'coupon_created':
+            $message['subject'] = $params['subject'];
+            $message['body'] = $params['body'];
+            break;
+    }
+}
+
+/**
\ No newline at end of file
 * Implementation of hook_token_list().
 */
 function uc_invite_discount_token_list($type = 'all')
