function system_send_email_action_form in Drupal 6
Same name and namespace in other branches
- 7 modules/system/system.module \system_send_email_action_form()
Return a form definition so the Send email action can be configured.
Parameters
$context: Default values (if we are editing an existing action instance).
Return value
Form definition.
See also
system_send_email_action_validate()
system_send_email_action_submit()
File
- modules/
system/ system.module, line 1665 - Configuration system that lets administrators modify the workings of the site.
Code
function system_send_email_action_form($context) {
// Set default values for form.
if (!isset($context['recipient'])) {
$context['recipient'] = '';
}
if (!isset($context['subject'])) {
$context['subject'] = '';
}
if (!isset($context['message'])) {
$context['message'] = '';
}
$form['recipient'] = array(
'#type' => 'textfield',
'#title' => t('Recipient'),
'#default_value' => $context['recipient'],
'#maxlength' => '254',
'#description' => t('The email address to which the message should be sent OR enter %author if you would like to send an e-mail to the author of the original post.', array(
'%author' => '%author',
)),
);
$form['subject'] = array(
'#type' => 'textfield',
'#title' => t('Subject'),
'#default_value' => $context['subject'],
'#maxlength' => '254',
'#description' => t('The subject of the message.'),
);
$form['message'] = array(
'#type' => 'textarea',
'#title' => t('Message'),
'#default_value' => $context['message'],
'#cols' => '80',
'#rows' => '20',
'#description' => t('The message that should be sent. You may include the following variables: %site_name, %username, %node_url, %node_type, %title, %teaser, %body, %term_name, %term_description, %term_id, %vocabulary_name, %vocabulary_description, %vocabulary_id. Not all variables will be available in all contexts.'),
);
return $form;
}