You are here

function user_relationship_mailer_user in User Relationships 5

Same name and namespace in other branches
  1. 5.2 plugins/user_relationship_mailer/user_relationship_mailer.module \user_relationship_mailer_user()
  2. 6 user_relationship_mailer/user_relationship_mailer.module \user_relationship_mailer_user()

hook_user()

File

plugins/user_relationship_mailer/user_relationship_mailer.module, line 165

Code

function user_relationship_mailer_user($type, &$edit, &$account, $category = NULL) {
  switch ($type) {
    case 'form':
      $form = array();
      if ($category == 'account' && variable_get('user_relationship_mailer_send_mail', FALSE) && user_access('maintain relationships', $account)) {
        $form['user_relationship_mailer_settings'] = array(
          '#type' => 'fieldset',
          '#title' => t('Relationship email settings'),
          '#weight' => 5,
        );
        $form['user_relationship_mailer_settings']['user_relationship_mailer_send_mail'] = array(
          '#type' => 'checkbox',
          '#title' => t('Receive relationship email notifications'),
          '#options' => $options,
          '#default_value' => isset($edit['user_relationship_mailer_send_mail']) ? $edit['user_relationship_mailer_send_mail'] : TRUE,
          '#description' => t("Check this if you'd like to receive relationship related email notifications"),
        );
      }
      return $form;
  }
}