version 1.185, 2006/06/12 22:55:23
|
version 1.186, 2006/11/01 22:22:31
|
Line 210 sub unpackmsgid {
|
Line 210 sub unpackmsgid {
|
|
|
sub sendemail { |
sub sendemail { |
my ($to,$subject,$body)=@_; |
my ($to,$subject,$body)=@_; |
|
my %senderemails=&Apache::loncommon::getemails(); |
|
my $senderaddress=''; |
|
foreach my $type ('notification','permanentemail','critnotification') { |
|
if ($senderemails{$type}) { |
|
$senderaddress=$senderemails{$type}; |
|
} |
|
} |
$body= |
$body= |
"*** ".&mt('This is an automatic message generated by the LON-CAPA system.')."\n". |
"*** ".&mt('This is an automatic message generated by the LON-CAPA system.')."\n". |
"*** ".&mt('Please do not reply to this address.')."\n\n".$body; |
"*** ".($senderaddress?&mt('You can reply to this message'):&mt('Please do not reply to this address.')."\n*** ". |
|
&mt('A reply will not be received by the recipient!'))."\n\n".$body; |
my $msg = new Mail::Send; |
my $msg = new Mail::Send; |
$msg->to($to); |
$msg->to($to); |
$msg->subject('[LON-CAPA] '.$subject); |
$msg->subject('[LON-CAPA] '.$subject); |
|
if ($senderaddress) { $msg->add('Reply-to',$senderaddress); } |
if (my $fh = $msg->open()) { |
if (my $fh = $msg->open()) { |
print $fh $body; |
print $fh $body; |
$fh->close; |
$fh->close; |
Line 390 sub user_crit_msg_raw {
|
Line 399 sub user_crit_msg_raw {
|
$status='no_host'; |
$status='no_host'; |
} |
} |
# Notifications |
# Notifications |
my %userenv = &Apache::lonnet::get('environment',['critnotification', |
my %userenv = &Apache::loncommon::getemails($user,$domain); |
'permanentemail'], |
|
$domain,$user); |
|
if ($userenv{'critnotification'}) { |
if ($userenv{'critnotification'}) { |
&sendnotification($userenv{'critnotification'},$user,$domain,$subject,1, |
&sendnotification($userenv{'critnotification'},$user,$domain,$subject,1, |
$text); |
$text); |