How to send a email message to specific user role when the site goes to the maintenance mode in drupal 7? I would like to use emails to communicate with users. So i really want to send a email message for all users(or just a number of users with specific role) when the site goes to the maintenance mode and send another one when the site comes online.

I checked triggers, rules, actions but couldn't find anything to help.

How can I solve this?
Checkout this module Maintenance mode API .


  Maintenance mode API notifies other modules when the site is switched into or from maintenance mode.
  
  This means that other modules can respond to this, for example:
  
  Alerting a list of users when the site goes into or out of maintenance mode


This module provides a hook, hook_change_maintenance_mode which any custom modules can interact

EDIT:

You can create a custom rule set with actions as send emails to your desired users. (An example guide how to create it).

Then invoke the rule set using rules_invoke_event() function inside the hook hook_change_maintenance_mode