system_send_email_action_form
function system_send_email_action_form
system_send_email_action_form($context)
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 3151
- 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 [node:author:mail], [comment:author:mail], etc. if you would like to send an e-mail to the author of the original post.'), ); $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 placeholders like [node:title], [user:name], and [comment:body] to represent data that will be different each time message is sent. Not all placeholders will be available in all contexts.'), ); return $form; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!system!system.module/function/system_send_email_action_form/7.x