2

How can I track user contact form submissions on Drupal 6?

I'm thinking of something similar to the webform results table but for user contact forms.

If not something that complex, then just simple statistics on contact form use, e.g. "UserX received 10 emails this month."

I'm pretty sure I'll have to create my own module which is fine, I just need to know how to go about this.

Do you have any ideas?

1
  • Why not just use webform? You can configure it to do just about everything that Contact Form module does :)
    – Alex Weber
    Commented May 24, 2011 at 16:33

2 Answers 2

2

What you could try is:

use hook_mail_alter() to check when mails have been send and store the information you need in a special table of your own module. Maybe the information in the $message is enough for you. If not you could try:

hook_fom_alter() to add an extra submit-handler to the contact form like this:

$form['#submit'][] = 'my_custom_submit_handler';

Inside my_custom_submit_handler($form, &$form_state) you should have full access to the form fields and store everything you need like you want to.

1

The Maillog / Mail Developer module will show you a log of all emails sent.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.