commit 14b717d7b3246b0a7108026f964d05e016b6d33a Author: Chris Graham Date: Mon Aug 16 20:43:11 2021 -0500 Implemented confirmation e-mail upon sending contact message diff --git a/lang/EN/mail.ini b/lang/EN/mail.ini index be5e3f0..81320dc 100644 --- a/lang/EN/mail.ini +++ b/lang/EN/mail.ini @@ -1,4 +1,6 @@ [strings] +YOUR_MESSAGE_WAS_SENT_TO_SUBJECT=Your message to {2} was sent ({1}) +YOUR_MESSAGE_WAS_SENT_TO_BODY=You recently sent {2} a message (repeated below). This e-mail is just to confirm the message was sent and to provide a copy for your own records. Please do not directly reply to this e-mail, as your reply will not be routed properly. Your message follows...\n\n{1} EMAIL_MEMBER_TEXT=You may use this form to send an e-mail to this member. If you are a member yourself, the member may also reply to you by e-mail, and will receive your e-mail address. EMAIL_MEMBER_SUBJECT=Personal e-mail from {1}: {2} NO_ACCEPT_EMAILS=This member does not accept e-mails diff --git a/site/pages/modules/contact_member.php b/site/pages/modules/contact_member.php index 39ebf2d..dfb4d9c 100644 --- a/site/pages/modules/contact_member.php +++ b/site/pages/modules/contact_member.php @@ -315,7 +315,17 @@ class Module_contact_member if ($size_so_far > $size * 1024 * 1024) { warn_exit(do_lang_tempcode('EXCEEDED_ATTACHMENT_SIZE', escape_html(integer_format($size)))); } - mail_wrap(do_lang('EMAIL_MEMBER_SUBJECT', get_site_name(), post_param_string('subject'), null, get_lang($member_id)), post_param_string('message'), array($email_address), $to_name, $from_email, $from_name, 3, $attachments, false, get_member(), false, false, false, 'MAIL', count($attachments) != 0, $extra_cc_addresses, $extra_bcc_addresses, $join_time); + + $subject = post_param_string('subject'); + $message = post_param_string('message'); + + mail_wrap(do_lang('EMAIL_MEMBER_SUBJECT', get_site_name(), $subject, null, get_lang($member_id)), $message, array($email_address), $to_name, $from_email, $from_name, 3, $attachments, false, get_member(), false, false, false, 'MAIL', count($attachments) != 0, $extra_cc_addresses, $extra_bcc_addresses, $join_time); + + // Send standard confirmation email to current user + if ($from_email != '' && get_option('message_received_emails') == '1') { + require_code('mail'); + mail_wrap(do_lang('YOUR_MESSAGE_WAS_SENT_TO_SUBJECT', $subject, $to_name), do_lang('YOUR_MESSAGE_WAS_SENT_TO_BODY', $message, $to_name), array($from_email), empty($from_name) ? null : $from_name, '', '', 3, null, false, get_member()); + } log_it('EMAIL', strval($member_id), $to_name);