You are here

function forena_confirm_email in Forena Reports 7

Same name and namespace in other branches
  1. 8 forena.common.inc \forena_confirm_email()
  2. 6.2 forena.common.inc \forena_confirm_email()
  3. 6 forena.common.inc \forena_confirm_email()
  4. 7.5 forena.common.inc \forena_confirm_email()
  5. 7.2 forena.common.inc \forena_confirm_email()
  6. 7.3 forena.common.inc \forena_confirm_email()
  7. 7.4 forena.common.inc \forena_confirm_email()

Email confirmation form. Confirms an email send based on mail merge

Parameters

array $docs An array of SimpleXML email documents to send:

integer $count Number of documents to send.:

1 string reference to 'forena_confirm_email'
FrxControls::emaildocument in plugins/FrxControls.inc

File

./forena.common.inc, line 955
Common functions used throughout the project but loaded in this file to keep the module file lean.

Code

function forena_confirm_email($form, &$form_state, $docs, $count) {
  if ($docs) {
    if (!variable_get('forena_email_override', FALSE)) {
      $form['send'] = array(
        '#type' => 'radios',
        '#title' => 'Send Email',
        '#options' => array(
          'send' => 'email to users',
          'test' => 'emails to me (test mode)',
        ),
        '#required' => TRUE,
      );
    }
    $form['max'] = array(
      '#type' => 'textfield',
      '#title' => 'Only send first',
      '#description' => 'In test mode only, limits the number of messages to send',
      '#default_value' => 1,
      '#size' => 3,
    );
    $form_state['storage']['docs'] = $docs;
    $form_state['storage']['count'] = $count;
  }
  return confirm_form($form, t('Send mail to users'), 'forena', t('Send email to %count users?', array(
    '%count' => $count,
  )));
}