function forena_confirm_email in Forena Reports 7.2
Same name and namespace in other branches
- 8 forena.common.inc \forena_confirm_email()
- 6.2 forena.common.inc \forena_confirm_email()
- 6 forena.common.inc \forena_confirm_email()
- 7.5 forena.common.inc \forena_confirm_email()
- 7 forena.common.inc \forena_confirm_email()
- 7.3 forena.common.inc \forena_confirm_email()
- 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 385 - Common functions used throughout the project but loaded in this file to keep the module file lean.
Code
function forena_confirm_email($formid, &$form_state, $docs, $count, $prompt_subject, $prompt_body) {
if ($docs) {
$values = @$form_state['values'];
if ($prompt_subject) {
$form['subject'] = array(
'#type' => 'textfield',
'#title' => t('Subject'),
'#default_value' => @$values['subject'],
);
}
if ($prompt_body) {
$form['body'] = array(
'#type' => 'text_format',
'#title' => t('Message'),
'#default_value' => @$values['body'],
'#format' => variable_get('forena_email_input_format', filter_default_format()),
);
}
if (!variable_get('forena_email_override', FALSE)) {
$form['send'] = array(
'#type' => 'radios',
'#title' => t('Send Email'),
'#options' => array(
'send' => 'email to users',
'test' => 'emails to me (test mode)',
),
'#default_value' => 'test',
);
}
$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,
)));
}