contact_mail_user_submit
modules/contact/contact.pages.inc, строка 207
- Версии
- 5
contact_mail_user_submit(
$form_id,$form_values)- 6
contact_mail_user_submit($form, &$form_state)
Process the personal contact page form submission.
Код
<?php
function contact_mail_user_submit($form, &$form_state) {
global $user, $language;
$account = $form_state['values']['recipient'];
// Send from the current user to the requested user.
$to = $account->mail;
$from = $user->mail;
// Save both users and all form values for email composition.
$values = $form_state['values'];
$values['account'] = $account;
$values['user'] = $user;
// Send the e-mail in the requested user language.
drupal_mail('contact', 'user_mail', $to, user_preferred_language($account), $values, $from);
// Send a copy if requested, using current page language.
if ($form_state['values']['copy']) {
drupal_mail('contact', 'user_copy', $from, $language, $values, $from);
}
flood_register_event('contact');
watchdog('mail', '%name-from sent %name-to an e-mail.', array('%name-from' => $user->name, '%name-to' => $account->name));
drupal_set_message(t('The message has been sent.'));
// Back to the requested users profile page.
$form_state['redirect'] = "user/$account->uid";
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии