version 1.194, 2006/12/28 18:47:15
|
version 1.196, 2007/02/09 15:30:48
|
Line 274 sub sendnotification {
|
Line 274 sub sendnotification {
|
$coursetext .= "\n\n"; |
$coursetext .= "\n\n"; |
} |
} |
my $body = $coursetext. |
my $body = $coursetext. |
&mt('You received a[_1] message from '.$sender.' in LON-CAPA.',$critical).' '.&mt("The subject is |
&mt('You received a'.$critical.' message from [_1] in LON-CAPA.',$sender).' '.&mt('The subject is |
|
|
$subj |
[_1] |
|
|
")."\n". |
',$subj)."\n". |
'=== '.&mt('Excerpt')." ============================================================ |
'=== '.&mt('Excerpt')." ============================================================ |
$text |
$text |
======================================================================== |
======================================================================== |
|
|
".&mt("Use |
".&mt('Use |
|
|
$url |
[_1] |
|
|
to access the full message."); |
to access the full message.',$url); |
&sendemail($to,'New'.$critical.' message from '.$sender,$body); |
&sendemail($to,'New'.$critical.' message from '.$sender,$body); |
} |
} |
# ============================================================= Check for email |
# ============================================================= Check for email |
Line 553 sub user_normal_msg_raw {
|
Line 553 sub user_normal_msg_raw {
|
unless (($env{'request.course.id'}) && |
unless (($env{'request.course.id'}) && |
(($env{'form.sendmode'} eq 'group') || |
(($env{'form.sendmode'} eq 'group') || |
(($env{'form.critmsg'}) || ($env{'form.sendbck'})) && |
(($env{'form.critmsg'}) || ($env{'form.sendbck'})) && |
(&Apache::lonnet::allowed('srm',$env{'request.course.id'}) |
(&Apache::lonnet::allowed('srm',$env{'request.course.id'}) |
|| &Apache::lonnet::allowed('srm',$env{'request.course.id'}. |
|| &Apache::lonnet::allowed('srm',$env{'request.course.id'}. |
'/'.$env{'request.course.sec'})))) { |
'/'.$env{'request.course.sec'})))) { |
(undef,my $packed_message_no_citation) = |
(undef,my $packed_message_no_citation) = |
&packagemsg($subject,$message,undef,$baseurl,$attachmenturl, |
&packagemsg($subject,$message,undef,$baseurl,$attachmenturl, |
$user,$domain,$currid,undef,$crsmsgid,$symb,$error); |
$user,$domain,$currid,undef,$crsmsgid,$symb,$error); |
Line 563 sub user_normal_msg_raw {
|
Line 563 sub user_normal_msg_raw {
|
&store_sent_mail($msgid,$packed_message_no_citation); |
&store_sent_mail($msgid,$packed_message_no_citation); |
} |
} |
} |
} |
} else { |
if (defined($newid)) { |
$status='no_host'; |
$$newid = $msgid; |
} |
} |
if (defined($newid)) { |
if (defined($sentmessage)) { |
$$newid = $msgid; |
$$sentmessage = $packed_message; |
} |
} |
if (defined($sentmessage)) { |
|
$$sentmessage = $packed_message; |
|
} |
|
|
|
# Notifications |
# Notifications |
my %userenv = &Apache::lonnet::get('environment',['notification', |
my %userenv = &Apache::lonnet::get('environment',['notification', |
'permanentemail'], |
'permanentemail'], |
$domain,$user); |
$domain,$user); |
if ($userenv{'notification'}) { |
if ($userenv{'notification'}) { |
&sendnotification($userenv{'notification'},$user,$domain,$subject,0, |
&sendnotification($userenv{'notification'},$user,$domain,$subject,0, |
$text,$msgid); |
$text,$msgid); |
} |
} |
if ($toperm && $userenv{'permanentemail'}) { |
if ($toperm && $userenv{'permanentemail'}) { |
&sendnotification($userenv{'permanentemail'},$user,$domain,$subject,0, |
&sendnotification($userenv{'permanentemail'},$user,$domain,$subject,0, |
$text,$msgid); |
$text,$msgid); |
} |
} |
&Apache::lonnet::log($env{'user.domain'},$env{'user.name'}, |
&Apache::lonnet::log($env{'user.domain'},$env{'user.name'}, |
$env{'user.home'}, |
$env{'user.home'}, |
'Sending '.$msgid.' to '.$user.' at '.$domain.' with status: '.$status); |
'Sending '.$msgid.' to '.$user.' at '.$domain.' with status: '.$status); |
|
} else { |
|
$status='no_host'; |
|
} |
return $status; |
return $status; |
} |
} |
|
|