You are here

function sharedemail_subuser_form_subuser_create_form_alter in Shared Email 6

Implementation of hook_form_alter(). Altering the subuser_create_form.

File

modules/sharedemail_subuser/sharedemail_subuser.module, line 13
Integrate Subuser and Shared Email modules.

Code

function sharedemail_subuser_form_subuser_create_form_alter(&$form, &$form_state) {
  $parent = user_load($form['parent_user']['#value']);
  $form['account']['mail']['#type'] = 'hidden';
  $form['account']['mail']['#default_value'] = $parent->mail;
  $form['account']['mail_message'] = array(
    '#value' => t('This account will share the email address !email with the parent account !parent.', array(
      '!email' => '<em>' . $parent->mail . '</em>',
      '!parent' => '<em>' . $parent->name . '</em>',
    )),
  );
}