diff --git a/classes/local_contact.php b/classes/local_contact.php index fc5712c..b1a1564 100644 --- a/classes/local_contact.php +++ b/classes/local_contact.php @@ -290,11 +290,13 @@ public function sendmessage($email, $name, $sendconfirmationemail = false) { // Include site name in subject field. $subject .= '[' . format_string($SITE->shortname, true, ['escape' => false, 'context' => $systemcontext]) . '] '; } - $subject .= optional_param( + /**$subject .= optional_param( get_string('field-subject', 'local_contact'), get_string('defaultsubject', 'local_contact'), PARAM_TEXT - ); + ); */ + // Use form-subject for mail-subject; if form-subject empty use defaultsubject + $subject .= (isset($_POST['subject']) && !empty($_POST['subject'])) ? $_POST['subject'] : get_string('defaultsubject', 'local_contact'); // Build the body of the email using user-entered information.