Diff for /loncom/interface/lonmsg.pm between versions 1.193 and 1.194

version 1.193, 2006/12/27 20:42:12 version 1.194, 2006/12/28 18:47:15
Line 246  sub sendemail { Line 246  sub sendemail {
 # ==================================================== Send notification emails  # ==================================================== Send notification emails
   
 sub sendnotification {  sub sendnotification {
     my ($to,$touname,$toudom,$subj,$crit,$text)=@_;      my ($to,$touname,$toudom,$subj,$crit,$text,$msgid)=@_;
     my $sender=$env{'environment.firstname'}.' '.$env{'environment.lastname'};      my $sender=$env{'environment.firstname'}.' '.$env{'environment.lastname'};
     unless ($sender=~/\w/) {       unless ($sender=~/\w/) { 
  $sender=$env{'user.name'}.'@'.$env{'user.domain'};   $sender=$env{'user.name'}.'@'.$env{'user.domain'};
Line 258  sub sendnotification { Line 258  sub sendnotification {
     my $url='http://'.      my $url='http://'.
       $Apache::lonnet::hostname{&Apache::lonnet::homeserver($touname,$toudom)}.        $Apache::lonnet::hostname{&Apache::lonnet::homeserver($touname,$toudom)}.
       '/adm/email?username='.$touname.'&domain='.$toudom;        '/adm/email?username='.$touname.'&domain='.$toudom;
     my $body=(<<ENDMSG);      my ($sendtime,$shortsubj,$fromname,$fromdomain,$status,$fromcid,
 You received a$critical message from $sender in LON-CAPA. The subject is          $symb,$error) = &Apache::lonmsg::unpackmsgid($msgid);
       my $coursetext;
       if ($fromcid ne '') {
           $coursetext = "\n".&mt('Course').': ';
           if ($env{'course.'.$fromcid.'.description'} ne '') {
               $coursetext .= $env{'course.'.$fromcid.'.description'};
           } else {
               my %coursehash = &Apache::lonnet::coursedescription($fromcid,);
               if ($coursehash{'description'} ne '') {
                   $coursetext .= $coursehash{'description'};
               }
           }
           $coursetext .= "\n\n";
       }
       my $body = $coursetext. 
                  &mt('You received a[_1] message from '.$sender.' in LON-CAPA.',$critical).' '.&mt("The subject is 
   
  $subj   $subj
   
 === Excerpt ============================================================  ")."\n".
   '=== '.&mt('Excerpt')." ============================================================
 $text  $text
 ========================================================================  ========================================================================
   
 Use  ".&mt("Use 
   
  $url   $url
   
 to access the full message.  to access the full message.");
 ENDMSG  
     &sendemail($to,'New'.$critical.' message from '.$sender,$body);      &sendemail($to,'New'.$critical.' message from '.$sender,$body);
 }  }
 # ============================================================= Check for email  # ============================================================= Check for email
Line 423  sub user_crit_msg_raw { Line 438  sub user_crit_msg_raw {
     my %userenv = &Apache::loncommon::getemails($user,$domain);      my %userenv = &Apache::loncommon::getemails($user,$domain);
     if ($userenv{'critnotification'}) {      if ($userenv{'critnotification'}) {
       &sendnotification($userenv{'critnotification'},$user,$domain,$subject,1,        &sendnotification($userenv{'critnotification'},$user,$domain,$subject,1,
  $text);   $text,$msgid);
     }      }
     if ($toperm && $userenv{'permanentemail'}) {      if ($toperm && $userenv{'permanentemail'}) {
       &sendnotification($userenv{'permanentemail'},$user,$domain,$subject,1,        &sendnotification($userenv{'permanentemail'},$user,$domain,$subject,1,
  $text);   $text,$msgid);
     }      }
 # Log this  # Log this
     &Apache::lonnet::logthis(      &Apache::lonnet::logthis(
Line 564  sub user_normal_msg_raw { Line 579  sub user_normal_msg_raw {
                                        $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);    $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);    $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'},

Removed from v.1.193  
changed lines
  Added in v.1.194


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>