mailgun.install 875 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /**
  3. * @file
  4. * Install, update and uninstall functions for the Mailgun module.
  5. */
  6. /**
  7. * Implements hook_uninstall().
  8. */
  9. function mailgun_uninstall() {
  10. // Delete variables.
  11. $variables = array('mailgun_api_key', 'mailgun_from_action', 'mailgun_from_name', 'mailgun_from_mail', 'mailgun_tracking', 'mailgun_tracking_clicks', 'mailgun_tracking_opens', 'mailgun_queue', 'mailgun_log', 'mailgun_format');
  12. foreach ($variables as $variable) {
  13. variable_del($variable);
  14. }
  15. }
  16. /**
  17. * Implements hook_enable().
  18. */
  19. function mailgun_enable() {
  20. mailsystem_set(array('mailgun_test' => 'MailgunMailSystem'));
  21. }
  22. /**
  23. * Implements hook_disable().
  24. */
  25. function mailgun_disable() {
  26. // Tell Mail System to remove Mailgun and restore to defaults.
  27. mailsystem_clear(array('mailgun_test' => 'MailgunMailSystem'));
  28. watchdog('mailgun', 'Mailgun has been disabled.');
  29. }