diff --git a/includes/mimemail.rules.inc b/includes/mimemail.rules.inc
index dfd7434..3e6b99f 100644
--- a/includes/mimemail.rules.inc
+++ b/includes/mimemail.rules.inc
@@ -19,17 +19,17 @@ function mimemail_rules_action_info() {
         'user' => array('type' => 'user', 'label' => t('Recipient')),
       ),
       'module' => 'Mime Mail',
-      'eval input' => array('sender', 'from', 'to', 'cc', 'bcc', 'subject', 'message_html', 'message_plaintext', 'attachments'),
+      'eval input' => array('key', 'sender', 'from', 'to', 'cc', 'bcc', 'subject', 'message_html', 'message_plaintext', 'attachments'),
     ),
     'mimemail_rules_action_mail' => array(
       'label' => t('Send an HTML mail to an arbitrary mail address'),
       'module' => 'Mime Mail',
-      'eval input' => array('sender', 'from', 'to', 'cc', 'bcc', 'subject', 'message_html', 'message_plaintext', 'attachments'),
+      'eval input' => array('key', 'sender', 'from', 'to', 'cc', 'bcc', 'subject', 'message_html', 'message_plaintext', 'attachments'),
     ),
     'mimemail_rules_action_mail_to_users_of_role' => array(
       'label' => t('Send an HTML mail to all users of a role'),
       'module' => 'Mime Mail',
-      'eval input' => array('sender', 'from', 'to', 'cc', 'bcc', 'subject', 'message_html', 'message_plaintext', 'attachments'),
+      'eval input' => array('key', 'sender', 'from', 'to', 'cc', 'bcc', 'subject', 'message_html', 'message_plaintext', 'attachments'),
     ),
   );
 }
@@ -40,6 +40,8 @@ function mimemail_rules_action_info() {
 function mimemail_rules_action_mail_to_user($user, $settings) {
   global $language;
 
+  $key = !empty($settings['key']) ? $settings['key'] : 'rules_action_mail';
+
   // Set the sender name and from address.
   if (empty($settings['from'])) {
     $from = NULL;
@@ -55,7 +57,7 @@ function mimemail_rules_action_mail_to_user($user, $settings) {
   $to = empty($settings['to']) ? $user->mail : $settings['to'];
 
   // Prepare the message but don't send.
-  $message = drupal_mail('mimemail', 'rules_action_mail', $to, $language, $settings, $from, FALSE);
+  $message = drupal_mail('mimemail', $key, $to, $language, $settings, $from, FALSE);
 
   // Send the prepared message.
   $message = mimemail(
@@ -88,6 +90,8 @@ function mimemail_rules_action_mail($settings) {
  * Implements action to send mail to all users of a specific role group(s).
  */
 function mimemail_rules_action_mail_to_users_of_role($settings) {
+  $key = !empty($settings['key']) ? $settings['key'] : 'rules_action_role_mail'; 
+
   $recipients = array_filter(array_keys(array_filter($settings['recipients'])));
 
   // All authenticated users, which is everybody.
@@ -113,7 +117,7 @@ function mimemail_rules_action_mail_to_users_of_role($settings) {
 
   while (($account = db_fetch_object($result))) {
     // Prepare the message but don't send.
-    $message = drupal_mail('mimemail', 'rules_action_role_mail',  $account->mail, user_preferred_language($account), $settings, $from, FALSE);
+    $message = drupal_mail('mimemail', $key,  $account->mail, user_preferred_language($account), $settings, $from, FALSE);
 
     // Send the prepared message.
     $message = mimemail(
diff --git a/includes/mimemail.rules_forms.inc b/includes/mimemail.rules_forms.inc
index 186cb66..0b30cff 100644
--- a/includes/mimemail.rules_forms.inc
+++ b/includes/mimemail.rules_forms.inc
@@ -12,8 +12,24 @@
  * Action "Send an HTML mail to a user" configuration form.
  */
 function mimemail_rules_action_mail_to_user_form($settings = array(), &$form) {
-  $settings += array('sender' => '', 'from' => '', 'subject' => '', 'message_html' => '', 'message_html_filter' => FILTER_FORMAT_DEFAULT, 'message_plaintext' => '', 'attachments' => '');
+  $settings += array(
+    'key' => '',
+    'sender' => '',
+    'from' => '',
+    'subject' => '',
+    'message_html' => '',
+    'message_html_filter' => FILTER_FORMAT_DEFAULT,
+    'message_plaintext' => '',
+    'attachments' => ''
+  );
 
+  $form['settings']['key'] = array(
+     '#type' => 'textfield',
+    '#title' => t('Key'),
+    '#default_value' => $settings['key'],
+    '#description' => t("An identifier for the message."),
+    '#required' => TRUE,
+  );
   $form['settings']['sender'] = array(
      '#type' => 'textfield',
     '#title' => t('Sender name'),
diff --git a/modules/mimemail_action/mimemail_action.module b/modules/mimemail_action/mimemail_action.module
index 47408c8..fa60535 100644
--- a/modules/mimemail_action/mimemail_action.module
+++ b/modules/mimemail_action/mimemail_action.module
@@ -30,6 +30,8 @@ function mimemail_action_info() {
 function mimemail_send_mail_action(&$object, $context = array()) {
   global $user;
 
+  $key = !empty($context['key']) ? $context['key'] : 'action_send_mail';
+
   switch ($context['hook']) {
     case 'nodeapi':
       // Because this is not an action of type 'node' (it's an action
@@ -81,7 +83,7 @@ function mimemail_send_mail_action(&$object, $context = array()) {
     $params['node'] = $node;
   }
 
-  $message = drupal_mail('mimemail', 'action_send_mail', $to, user_preferred_language($account), $params, NULL, FALSE);
+  $message = drupal_mail('mimemail', $key, $to, user_preferred_language($account), $params, NULL, FALSE);
 
   $message = mimemail(
     $message['from'],
@@ -109,8 +111,25 @@ function mimemail_send_mail_action(&$object, $context = array()) {
  * Form for configurable Drupal action to send an HTML mail.
  */
 function mimemail_send_mail_action_form($context) {
-  $context += array('to' => '', 'cc' => '', 'bcc' => '', 'subject' => '', 'message_html' => '', 'message_html_filter' => FILTER_FORMAT_DEFAULT, 'message_plaintext' => '', 'attachments' => '');
+  $context += array(
+    'key' => '',
+    'to' => '',
+    'cc' => '',
+    'bcc' => '',
+    'subject' => '',
+    'message_html' => '',
+    'message_html_filter' => FILTER_FORMAT_DEFAULT,
+    'message_plaintext' => '',
+    'attachments' => ''
+  );
 
+  $form['key'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Key'),
+    '#default_value' => $context['key'],
+    '#description' => t("An identifier for the message."),
+    '#required' => TRUE,
+  );
   $form['to'] = array(
     '#type' => 'textfield',
     '#title' => t('Recipient'),
@@ -199,6 +218,7 @@ function mimemail_send_mail_action_submit($form, $form_state) {
   $form_values = $form_state['values'];
 
   $params = array(
+    'key' => $form_values['key'],
     'to' => $form_values['to'],
     'cc' => $form_values['cc'],
     'bcc' => $form_values['bcc'],
