Action on every nth node creation I have a content type of event. I need to send all users an email after each 5th events saved, listing this 5 recently created events. What would be the most proper way to do that? I am tending to use hook_node_insert but I'm not sure how to check if it is the 5th node after the last email sent.
You could run an EntityFieldQuery on hook_node_insert to count all of the nodes of type event and then see if that count plus one (because the new node isn't saved to the DB yet) is divisible by five. Something like this:

function mymodule_node_insert() {
  $query = new EntityFieldQuery();
  $result = $query-&gt;entityCondition('entity_type', 'node')
    -&gt;entityCondition('bundle', 'event')
    -&gt;execute();
  $count = (count($result['node']) + 1);
  if (!($count % 5)) {
    // Generate/Send your email
  }
}


Note that the code above is totally untested.