Drupal - Module Dev conditional email action
I am writing a module for Drupal 6.x and I have it mostly working. Currently the user defines a tag, an email threshold interval value, configures an email action and emails when triggered by an authenticated user viewing content.
This all works, except I need to do the following now,
Conditions for the hook_mail() function
-Does the node contain the defined term? (if so email)
-Determine if the user admin (if so don't email)
-Is the user a member of the support group (if so don't email)
-Has there been an email for this user sent already within the email threshold value. (if so don't email)
I am very confused, Drupals documentation for this type is in typical Opensource fashion and their forums are not nearly as friendly as this one. I am planning on releasing this module into the community after completion.