View Issue Details

IDProjectCategoryView StatusLast Update
4674Composrcns_contact_memberpublic2022-10-19 00:49
ReporterChris Graham Assigned ToPDStig  
PrioritynormalSeverityfeature 
Status resolvedResolutionfixed 
Summary4674: Confirmation emails for contact_member
DescriptionSend a confirmation email to the message sender to confirm a message was sent and email is working.

Implementation attached, it's simple.

string_scan.php needs editing to add the new lang strings.
TagsHas Patch, Roadmap: v11
Attach Tags
Attached Files
contact_member_confirmation.diff (2,725 bytes)   
commit 14b717d7b3246b0a7108026f964d05e016b6d33a
Author: Chris Graham <[email protected]>
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);
 
Time estimation (hours)0.1
Sponsorship open

Sponsor

Date Added Member Amount Sponsored

Activities

Issue History

Date Modified Username Field Change
2021-08-17 01:52 Chris Graham New Issue
2021-08-17 01:52 Chris Graham Tag Attached: Roadmap: v12
2021-08-17 01:52 Chris Graham File Added: contact_member_confirmation.diff
2021-11-01 20:10 Chris Graham Tag Attached: Has Patch
2022-08-15 16:59 Chris Graham Tag Detached: Roadmap: v12
2022-08-15 16:59 Chris Graham Tag Attached: Roadmap: v11
2022-08-15 20:13 Chris Graham Assigned To => user4172
2022-08-15 20:13 Chris Graham Status Not Assigned => Assigned
2022-10-19 00:49 PDStig Status Assigned => Resolved
2022-10-19 00:49 PDStig Resolution open => fixed