--- loncom/interface/lonsupportreq.pm 2023/07/26 01:03:58 1.105 +++ loncom/interface/lonsupportreq.pm 2024/07/15 17:12:40 1.106 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Helpdesk request form # -# $Id: lonsupportreq.pm,v 1.105 2023/07/26 01:03:58 raeburn Exp $ +# $Id: lonsupportreq.pm,v 1.106 2024/07/15 17:12:40 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -762,6 +762,8 @@ sub print_request_receipt { secn => 'Section', warn => 'Warning: Problem with support e-mail address', your => 'Your support request contained the following information', + belo => 'Below is your support request which could not be sent', + ifyk => 'If you know an IT support address for your institution, you could copy this information and send it to that email address.', sect => 'section', info => 'Information supplied', adin => 'Additional information recorded', @@ -990,16 +992,16 @@ END my $message; if (!$bad_email) { - $message = &Apache::lonhtmlcommon::confirm_success( - &mt('A support request has been sent to [_1]',''.$to.'')); + $message = &mt('A support request has been sent to [_1]',''.$to.''); } else { - $message = &Apache::lonhtmlcommon::confirm_success( - $lt{'warn'}.'
' - .&mt('As the e-mail address provided for this LON-CAPA server ([_1]) does not appear to be a valid e-mail address, your support request has [_2]not[_3] been sent to the LON-CAPA support staff or administrator at your institution.',''.$to.'','','') - .' '.&mt('Instead a copy has been sent to the LON-CAPA support team at Michigan State University.'),1); - $to = 'helpdesk@lon-capa.org'; + $message = $lt{'warn'}.'
'; + if ($to eq '') { + $message .= &mt('For this LON-CAPA server no e-mail address has been configured to receive support requests, so your support request has [_1]not[_2] been sent to the LON-CAPA support staff or administrator at your institution.','',''); + } else { + $message .= &mt('As the e-mail address provided for this LON-CAPA server ([_1]) does not appear to be a valid e-mail address, your support request has [_2]not[_3] been sent to the LON-CAPA support staff or administrator at your institution.',''.$to.'','',''); + } } - $r->print(&Apache::loncommon::confirmwrapper($message)); + $r->print(&Apache::loncommon::confirmwrapper(&Apache::lonhtmlcommon::confirm_success($message,$bad_email))); if ($reqemail ne '') { $from = $reqemail; @@ -1126,14 +1128,18 @@ END } } - # Compose and send a MIME email - &Apache::loncommon::mime_email($from,'',$to,$subject,$supportmsg,$cc_string, - $bcc,$attachmentpath,$fname,$attachment_text); - + if ($bad_email) { + $r->print(''.$lt{'belo'}.'
'. + $lt{'ifyk'}.'

'."\n"); + } else { + # Compose and send a MIME email + &Apache::loncommon::mime_email($from,'',$to,$subject,$supportmsg,$cc_string, + $bcc,$attachmentpath,$fname,$attachment_text); + $r->print(''.$lt{'your'}.':

'."\n"); + } if ($attachmentpath =~ m|$Apache::lonnet::perlvar{'lonDaemons'}/tmp/helprequests/(\d+)/[^/]+|) { unlink($attachmentpath); } - $r->print(''.$lt{'your'}.':

'."\n"); $r->print('
'. &Apache::lonhtmlcommon::start_pick_box(). &Apache::lonhtmlcommon::row_title($lt{'info'},undef,'LC_oddrow_value')."\n".$displaymsg."\n".