function htmlmail_test_form in HTML Mail 8.2
Same name and namespace in other branches
- 5 htmlmail.module \htmlmail_test_form()
- 6.2 htmlmail.admin.inc \htmlmail_test_form()
- 6 htmlmail.admin.inc \htmlmail_test_form()
- 7.2 htmlmail.admin.inc \htmlmail_test_form()
- 7 htmlmail.admin.inc \htmlmail_test_form()
Builds a form for sending a test message.
1 string reference to 'htmlmail_test_form'
- htmlmail_menu in ./
htmlmail.module - Implements hook_menu().
File
- ./
htmlmail.admin.inc, line 228 - Admin forms for HTML Mail
Code
function htmlmail_test_form($form_values = NULL) {
$defaults = variable_get('htmlmail_test', array(
'to' => variable_get('site_mail', 'user@example.com'),
'subject' => 'test',
'body' => array(
'value' => 'test',
),
));
$defaults['body']['format'] = filter_fallback_format();
$form['to'] = array(
'#type' => 'textfield',
'#title' => t('To'),
'#default_value' => $defaults['to'],
'#maxlength' => 128,
'#required' => TRUE,
);
$form['subject'] = array(
'#type' => 'textfield',
'#title' => t('Subject'),
'#default_value' => $defaults['subject'],
'#maxlength' => 128,
'#required' => TRUE,
);
$form['body'] = array(
'#type' => 'text_format',
'#title' => t('Body'),
'#rows' => 20,
'#default_value' => $defaults['body']['value'],
'#format' => $defaults['body']['format'],
'#required' => TRUE,
);
$mailsystem = mailsystem_get();
if (empty($mailsystem['htmlmail'])) {
$mailsystem['htmlmail'] = 'HTMLMailSystem';
}
$form['class'] = array(
'#type' => 'select',
'#title' => t('Test mail sending class'),
'#default_value' => $mailsystem['htmlmail'],
'#options' => array_combine(mailsystem_get_classes(), mailsystem_get_classes()),
'#description' => 'Select the MailSystemInterface implementation to be tested.',
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Send test message'),
);
return $form;
}