function pm_email_notify_form_privatemsg_admin_settings_alter in Privatemsg 7
Same name and namespace in other branches
- 7.2 pm_email_notify/pm_email_notify.module \pm_email_notify_form_privatemsg_admin_settings_alter()
Implements hook_form_FORM_ID_alter().
File
- pm_email_notify/
pm_email_notify.module, line 129 - Notifies users about new Private Messages via Email.
Code
function pm_email_notify_form_privatemsg_admin_settings_alter(&$form, &$form_state) {
$form['pm_email_notify'] = array(
'#type' => 'fieldset',
'#title' => t('E-mail notify'),
'#group' => 'settings',
'#weight' => 22,
);
$form['pm_email_notify']['pm_email_notify_default'] = array(
'#type' => 'checkbox',
'#title' => t('Notify users of new private messages by default'),
'#default_value' => variable_get('pm_email_notify_default', TRUE),
'#weight' => 0,
);
$form['pm_email_notify']['pm_email_notify_desc'] = array(
'#type' => 'item',
'#title' => t('Customize the email messages sent to users upon receipt of a new private message.'),
'#weight' => 1,
);
$form['pm_email_notify']['pm_email_notify_from'] = array(
'#type' => 'textfield',
'#title' => t('From e-mail address for notifications'),
'#default_value' => variable_get('pm_email_notify_from', ''),
'#weight' => 2,
'#description' => t('This is the e-mail address that notifications will come from. Leave blank to use the site default.'),
);
$form['pm_email_notify']['pm_email_notify_subject'] = array(
'#type' => 'textfield',
'#title' => t('Subject of notification messages'),
'#default_value' => variable_get('pm_email_notify_subject', t('New private message at [site:name].')),
'#weight' => 2,
);
$form['pm_email_notify']['pm_email_notify_body'] = array(
'#type' => 'textarea',
'#title' => t('Body of notification messages'),
'#default_value' => variable_get('pm_email_notify_body', _pm_email_notify_default_body()),
'#weight' => 3,
);
if (module_exists('token')) {
$form['pm_email_notify']['token'] = array(
'#type' => 'fieldset',
'#title' => t('Token browser'),
'#weight' => -1,
'#collapsible' => TRUE,
'#collapsed' => TRUE,
'#weight' => 4,
);
$form['pm_email_notify']['token']['browser'] = array(
'#theme' => 'token_tree',
'#token_types' => array(
'privatemsg_message',
),
);
}
else {
$form['pm_email_notify']['token'] = array(
'#type' => 'fieldset',
'#title' => t('Token Suggestions'),
'#weight' => -1,
'#collapsible' => TRUE,
'#collapsed' => TRUE,
'#weight' => 4,
);
$form['pm_email_notify']['token']['suggestions'] = array(
'#type' => 'item',
'#markup' => t('Many tokens may be used, including: [privatemsg_message:url], [privatemsg_message:thread-id], [privatemsg_message:author:name], [privatemsg_message:author:uid], [privatemsg_message:recipient:name], [privatemsg_message:subject], [privatemsg_message:body]. Enable the <a href="https://drupal.org/project/token">Token module</a> to see all available.'),
);
}
return system_settings_form($form);
}