diff options
author | Dries Buytaert <dries@buytaert.net> | 2005-08-11 07:33:21 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2005-08-11 07:33:21 +0000 |
commit | 9e45d24af3551c16858df1901387d53b3182a4f3 (patch) | |
tree | 9f09bdbe6a86c6d94c25e7d6f69b6acab26b654e | |
parent | 6baa2ba1408537e021de8ae987b2f83f2a31e493 (diff) | |
download | brdo-9e45d24af3551c16858df1901387d53b3182a4f3.tar.gz brdo-9e45d24af3551c16858df1901387d53b3182a4f3.tar.bz2 |
- Patch #26236 by Robin Monks: added 'send me a copy'-functionality to the contact forms.
-rw-r--r-- | modules/contact.module | 12 | ||||
-rw-r--r-- | modules/contact/contact.module | 12 |
2 files changed, 24 insertions, 0 deletions
diff --git a/modules/contact.module b/modules/contact.module index 9e1463c83..62e302898 100644 --- a/modules/contact.module +++ b/modules/contact.module @@ -129,6 +129,11 @@ function contact_mail_user() { // Send the e-mail: user_mail($to, $subject, $body, "From: $from\nReply-to: $from\nX-Mailer: Drupal\nReturn-path: $from\nErrors-to: $from"); + // Send a copy if requested: + if ($edit['copy']) { + user_mail($from, $subject, $body, "From: $from\nReply-to: $from\nX-Mailer: Drupal\nReturn-path: $from\nErrors-to: $from"); + } + // Log the operation: flood_register_event('contact'); watchdog('mail', t('%name-from sent %name-to an e-mail.', array('%name-from' => theme('placeholder', $user->name), '%name-to' => theme('placeholder', $account->name)))); @@ -148,6 +153,7 @@ function contact_mail_user() { $output .= form_item(t('To'), $account->name); $output .= form_textfield(t('Subject'), 'subject', $edit['subject'], 60, 50, NULL, NULL, TRUE); $output .= form_textarea(t('Message'), 'message', $edit['message'], 60, 15, NULL, NULL, TRUE); + $output .= form_checkbox(t('Send me a copy.'), 'copy', $edit['copy']); $output .= form_submit(t('Send e-mail')); $output = form($output); } @@ -280,6 +286,11 @@ function contact_mail_page() { // Send the e-mail to the recipients: user_mail($contact->recipients, $subject, $body, "From: $from\nReply-to: $from\nX-Mailer: Drupal\nReturn-path: $from\nErrors-to: $from"); + // If the user requests it, send a copy. + if ($edit['copy']) { + user_mail($from, $subject, $body, "From: $from\nReply-to: $from\nX-Mailer: Drupal\nReturn-path: $from\nErrors-to: $from"); + } + // Send an auto-reply if necessary: if ($contact->reply) { user_mail($from, $subject, wordwrap($contact->reply), "From: $contact->recipients\nReply-to: $contact->recipients\nX-Mailer: Drupal\nReturn-path: $contact->recipients\nErrors-to: $contact->recipients"); @@ -316,6 +327,7 @@ function contact_mail_page() { $output .= form_select(t('Category'), 'category', $edit['category'], $categories, NULL, NULL, NULL, TRUE); } $output .= form_textarea(t('Message'), 'message', $edit['message'], 60, 5, NULL, NULL, TRUE); + $output .= form_checkbox(t('Send me a copy.'), 'copy', $edit['copy']); $output .= form_submit(t('Send e-mail')); $output = form($output); } diff --git a/modules/contact/contact.module b/modules/contact/contact.module index 9e1463c83..62e302898 100644 --- a/modules/contact/contact.module +++ b/modules/contact/contact.module @@ -129,6 +129,11 @@ function contact_mail_user() { // Send the e-mail: user_mail($to, $subject, $body, "From: $from\nReply-to: $from\nX-Mailer: Drupal\nReturn-path: $from\nErrors-to: $from"); + // Send a copy if requested: + if ($edit['copy']) { + user_mail($from, $subject, $body, "From: $from\nReply-to: $from\nX-Mailer: Drupal\nReturn-path: $from\nErrors-to: $from"); + } + // Log the operation: flood_register_event('contact'); watchdog('mail', t('%name-from sent %name-to an e-mail.', array('%name-from' => theme('placeholder', $user->name), '%name-to' => theme('placeholder', $account->name)))); @@ -148,6 +153,7 @@ function contact_mail_user() { $output .= form_item(t('To'), $account->name); $output .= form_textfield(t('Subject'), 'subject', $edit['subject'], 60, 50, NULL, NULL, TRUE); $output .= form_textarea(t('Message'), 'message', $edit['message'], 60, 15, NULL, NULL, TRUE); + $output .= form_checkbox(t('Send me a copy.'), 'copy', $edit['copy']); $output .= form_submit(t('Send e-mail')); $output = form($output); } @@ -280,6 +286,11 @@ function contact_mail_page() { // Send the e-mail to the recipients: user_mail($contact->recipients, $subject, $body, "From: $from\nReply-to: $from\nX-Mailer: Drupal\nReturn-path: $from\nErrors-to: $from"); + // If the user requests it, send a copy. + if ($edit['copy']) { + user_mail($from, $subject, $body, "From: $from\nReply-to: $from\nX-Mailer: Drupal\nReturn-path: $from\nErrors-to: $from"); + } + // Send an auto-reply if necessary: if ($contact->reply) { user_mail($from, $subject, wordwrap($contact->reply), "From: $contact->recipients\nReply-to: $contact->recipients\nX-Mailer: Drupal\nReturn-path: $contact->recipients\nErrors-to: $contact->recipients"); @@ -316,6 +327,7 @@ function contact_mail_page() { $output .= form_select(t('Category'), 'category', $edit['category'], $categories, NULL, NULL, NULL, TRUE); } $output .= form_textarea(t('Message'), 'message', $edit['message'], 60, 5, NULL, NULL, TRUE); + $output .= form_checkbox(t('Send me a copy.'), 'copy', $edit['copy']); $output .= form_submit(t('Send e-mail')); $output = form($output); } |