/**
* Implements hook_menu().
*/
function notification_menu() {
$items = [];
$items['admin/customize'] = [
'title' => 'Send Comment notifications',
'discription' => 'Admin will send notification to user about updates',
'type' => MENU_NORMAL_ITEM,
'page callback' => 'drupal_get_form',
'page arguments' => ['notification_form'],
'access arguments' => ['access adminstration page'],
'access callback' => TRUE,
];
return $items;
}
/**
* Custom form.
*/
function notification_form($form, &$form_state) {
$form['send_mail_to'] = [
'#title' => 'Send Mail To',
'#discription' => 'To whom you want to send form',
'#size' => 40,
'#type' => 'textfield',
'#required' => TRUE,
'#default_value' => variable_get('send_mail_to'),
];
//here the admin can wite subject for the mail.
$form['mail_subject'] = [
'#title' => 'Subject',
'#discription' => 'the purpous of this mail',
'#type' => 'textfield',
'#size' => 40,
'#maxlenght' => 120,
'#required' => TRUE,
'#default_value' => variable_get('mail_subject'),
];
$form['mail_body'] = [
'#title' => 'Body',
'#discription' => 'the body of your mail.',
'#type' => 'textarea',
'#row' => 10,
'#columns' => 40,
'#required' => TRUE,
'#default_value' => variable_get('mail_body'),
];
$form['mail_bcc'] = [
'#title' => 'BCC this mail to all',
'#type' => 'checkbox',
];
return system_settings_form($form);
}