By shasi kanth


2018-05-17 10:13:28 8 Comments

I would like to send an email to some users, when i put my Drupal-7 website in maintenance mode. Are there any hooks that allow me to do this? I could not figure it out for myself.

1 comments

@Ajay Reddy 2018-05-17 11:11:08

As @Clive said you can use hook_form_alter() or hook_form_FORM_ID_alter() and add extra submit handler to send email notifications.

function YOURMODULE_form_system_site_maintenance_mode_alter(&$form, &$form_state, $form_id) {
  $form['#submit'][] = 'email_system_settings_form_submit';
}

function email_system_settings_form_submit($form, &$form_state) {
  // Add your email code here
}

Related Questions

Sponsored Content

1 Answered Questions

[SOLVED] Maintenance mode and user session

  • 2018-06-29 09:02:02
  • Michael
  • 147 View
  • 1 Score
  • 1 Answer
  • Tags:   maintenance-mode

1 Answered Questions

2 Answered Questions

2 Answered Questions

1 Answered Questions

4 Answered Questions

[SOLVED] What does maintenance mode do?

  • 2015-03-12 03:00:43
  • Allen
  • 1947 View
  • 0 Score
  • 4 Answer
  • Tags:   maintenance-mode

1 Answered Questions

[SOLVED] Adding Information to Maintenance mode message

  • 2013-12-11 20:49:44
  • CW Smith
  • 292 View
  • 0 Score
  • 1 Answer
  • Tags:   maintenance-mode

1 Answered Questions

Sponsored Content