You are here

function protected_pages_send_email in Protected Pages 7

Same name and namespace in other branches
  1. 7.2 protected_pages.admin.inc \protected_pages_send_email()

Callback function for send protected pages details email form.

1 string reference to 'protected_pages_send_email'
protected_pages_menu in ./protected_pages.module
Implements hook_menu().

File

./protected_pages.admin.inc, line 272
Provides page callbacks for configuration page.

Code

function protected_pages_send_email($form, &$form_state, $pid) {
  $destination = drupal_get_destination();
  $form['send_email_box'] = array(
    '#type' => 'fieldset',
    '#title' => t('Send email'),
    '#description' => t('You send details of this protected page by email to multiple users. Please click !here to configure email settings.', array(
      '!here' => l(t('here'), 'admin/config/system/protected_pages/settings', array(
        'query' => $destination,
      )),
    )),
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
  );
  $form_state['pid'] = $pid;
  $form['send_email_box']['recipents'] = array(
    '#type' => 'textarea',
    '#title' => t('Recipents'),
    '#rows' => 5,
    '#description' => t('Enter enter comma separated list of recipents.'),
    '#required' => TRUE,
  );
  $form['send_email_box']['subject'] = array(
    '#type' => 'textfield',
    '#title' => t('Subject'),
    '#default_value' => variable_get('protected_pages_email_subject', protected_pages_email_subject()),
    '#description' => t('Enter subject of email.'),
    '#required' => TRUE,
  );
  $form['send_email_box']['body'] = array(
    '#type' => 'textarea',
    '#title' => t('Email Body'),
    '#rows' => 15,
    '#default_value' => variable_get('protected_pages_email_body', protected_pages_email_body()),
    '#description' => t('Enter the body of the email. Only [protected-page-url] and [site-name] tokens are available.
      Since password is encrypted, therefore we can not provide it by token.'),
    '#required' => TRUE,
  );
  $form['send_email_box']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Send Email'),
  );
  return $form;
}