? 306662_contact_trigger.patch
? 306662_contact_trigger_1_0.patch
Index: modules/contact/contact.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/contact/contact.module,v
retrieving revision 1.127
diff -u -p -r1.127 contact.module
--- modules/contact/contact.module	22 Sep 2009 07:50:15 -0000	1.127
+++ modules/contact/contact.module	25 Sep 2009 12:08:41 -0000
@@ -201,3 +201,16 @@ function contact_mail($key, &$message, $
       break;
   }
 }
+
+/**
+ * Implement hook_trigger_info().
+ */
+function contact_trigger_info() {
+  return array(
+    'contact' => array(
+      'contact_send' => array(
+        'label' => t('After completing the contact form'),
+      ),
+    ),
+  );
+}
Index: modules/contact/contact.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/contact/contact.pages.inc,v
retrieving revision 1.24
diff -u -p -r1.24 contact.pages.inc
--- modules/contact/contact.pages.inc	18 Sep 2009 00:12:46 -0000	1.24
+++ modules/contact/contact.pages.inc	25 Sep 2009 12:08:41 -0000
@@ -143,6 +143,9 @@ function contact_site_form_submit($form,
   watchdog('mail', '%name-from sent an e-mail regarding %category.', array('%name-from' => $values['name'] . " [$from]", '%category' => $contact['category']));
   drupal_set_message(t('Your message has been sent.'));
 
+  // Fire the contact form trigger.
+  module_invoke_all('contact_send', $values);
+
   // Jump to home page rather than back to contact page to avoid
   // contradictory messages if flood control has been activated.
   $form_state['redirect'] = '';
@@ -231,6 +234,9 @@ function contact_personal_form_submit($f
   watchdog('mail', '%name-from sent %name-to an e-mail.', array('%name-from' => $user->name, '%name-to' => $account->name));
   drupal_set_message(t('Your message has been sent.'));
 
+  // Fire the contact form trigger.
+  module_invoke_all('contact_send', $values);
+
   // Back to the requested users profile page.
   $form_state['redirect'] = "user/$account->uid";
 }
