You are here

function mail_logger_enable in Mail Logger 6

Same name and namespace in other branches
  1. 5 mail_logger.install \mail_logger_enable()
  2. 7 mail_logger.install \mail_logger_enable()

Implementation of hook_enable().

File

./mail_logger.install, line 100
Install and update functions for Mail Logger module.

Code

function mail_logger_enable() {

  // Because modules can modify the outgoing mail, mail_logger must be executed last in order to capture
  // the final mail parameters by setting the weight of mail_logger to something large.
  $max_weight = db_result(db_query("SELECT max(weight) FROM {system} WHERE name <> 'mail_logger'"));
  db_query("UPDATE {system} SET weight = %d WHERE name = 'mail_logger'", $max_weight + 100);
}