[system] / trunk / webwork / system / cgi / cgi-scripts / profSendMail.pl Repository:
ViewVC logotype

Diff of /trunk/webwork/system/cgi/cgi-scripts/profSendMail.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 75 Revision 76
43my $courseScriptsDirectory = $Global::courseScriptsDirectory; 43my $courseScriptsDirectory = $Global::courseScriptsDirectory;
44my $templateDirectory = getCourseTemplateDirectory; 44my $templateDirectory = getCourseTemplateDirectory;
45my $emailDirectory = getCourseEmailDirectory; 45my $emailDirectory = getCourseEmailDirectory;
46my $scoringDirectory = getCourseScoringDirectory; 46my $scoringDirectory = getCourseScoringDirectory;
47my $feedbackAddress = $Global::feedbackAddress; 47my $feedbackAddress = $Global::feedbackAddress;
48my $defaultfrom = $Global::defaultfrom;
49my $defaultreply = $Global::defaultreply;
48my $defaultClasslistFile = getCourseClasslistFile($course); 50my $defaultClasslistFile = getCourseClasslistFile($course);
49my $default_msg = 'default.msg'; 51my $default_msg = 'default.msg';
50my $old_default_msg = 'default_old.msg'; 52my $old_default_msg = 'default_old.msg';
51 53
52require "${scriptDirectory}$Global::FILE_pl"; 54require "${scriptDirectory}$Global::FILE_pl";
639 my $header = ''; 641 my $header = '';
640 my ($subject, $from, $replyTo, $cc); 642 my ($subject, $from, $replyTo, $cc);
641 if (-e "$emailDirectory$messageFileName") { 643 if (-e "$emailDirectory$messageFileName") {
642 open FILE, "$emailDirectory$messageFileName"; 644 open FILE, "$emailDirectory$messageFileName";
643 while ($header !~ s/Message:\s*$//m) { $header .= <FILE>; } 645 while ($header !~ s/Message:\s*$//m) { $header .= <FILE>; }
644 $text = join "", <FILE>; 646 $text = join '', <FILE>;
645
646 $header =~ /^From:\s*(.*)$/m; 647 $header =~ /^From:\s(.*)$/m;
647 $from = $1 or $from = $feedbackAddress; #given email address or default feedback address 648 $from = $1 or $from = $defaultfrom; #given email address or default feedback address
648 $header =~ /^Reply-To:\s*(.*)$/m; 649 $header =~ /^Reply-To:\s(.*)$/m;
649 $replyTo = $1 or $replyTo = $feedbackAddress; 650 $replyTo = $1 or $replyTo = $defaultreply;
650 $header =~ /^Cc:\s*(.*)$/m; 651 $header =~ /^Cc:\s(.*)$/m;
651 $cc = $1; 652 $cc = $1;
652 $header =~ /^Subject:\s*(.*)$/m; 653 $header =~ /^Subject:\s(.*)$/m;
653 $subject = $1; 654 $subject = $1;
654
655
656 } else { 655 } else {
657 # wwerror($0, "Message File $emailDirectory$messageFileName does not exist!"); 656 # wwerror($0, "Message File $emailDirectory$messageFileName does not exist!");
658 } 657 }
659 658
660# show professors's name and email address 659# show professors's name and email address

Legend:
Removed from v.75  
changed lines
  Added in v.76

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9