View | Details | Raw Unified | Return to bug 8000
Collapse All | Expand All

(-)a/C4/Letters.pm (-3 / +14 lines)
Lines 284-290 sub SendAlerts { Link Here
284
        foreach (@$alerts) {
284
        foreach (@$alerts) {
285
285
286
            my $borinfo = C4::Members::GetMember('borrowernumber' => $_->{'borrowernumber'});
286
            my $borinfo = C4::Members::GetMember('borrowernumber' => $_->{'borrowernumber'});
287
            my $email = $borinfo->{email} or next;
287
            my $sendAllEmailsTo = C4::Context->preference('SendAllEmailsTo');
288
            my $email = $sendAllEmailsTo;
289
            if (!($sendAllEmailsTo && $sendAllEmailsTo =~ /@/) ){ # some validation.  This could be improved.
290
                $email = $borinfo->{email} or next;
291
            }
288
292
289
            # 		warn "sending issues...";
293
            # 		warn "sending issues...";
290
            my $userenv = C4::Context->userenv;
294
            my $userenv = C4::Context->userenv;
Lines 368-376 sub SendAlerts { Link Here
368
            want_librarian => 1,
372
            want_librarian => 1,
369
        ) or return;
373
        ) or return;
370
374
375
        my $allemails = join( ',', @email);
376
        my $sendAllEmailsTo = C4::Context->preference('SendAllEmailsTo');
377
        $allemails = $sendAllEmailsTo if ($sendAllEmailsTo && $sendAllEmailsTo =~ /@/ ); # some validation.  This could be improved.
371
        # ... then send mail
378
        # ... then send mail
372
        my %mail = (
379
        my %mail = (
373
            To => join( ',', @email),
380
            To             => $allemails,
374
            From           => $userenv->{emailaddress},
381
            From           => $userenv->{emailaddress},
375
            Subject        => Encode::encode( "utf8", "" . $letter->{title} ),
382
            Subject        => Encode::encode( "utf8", "" . $letter->{title} ),
376
            Message        => Encode::encode( "utf8", "" . $letter->{content} ),
383
            Message        => Encode::encode( "utf8", "" . $letter->{content} ),
Lines 406-413 sub SendAlerts { Link Here
406
        ) or return;
413
        ) or return;
407
414
408
        return { error => "no_email" } unless $externalid->{'emailaddr'};
415
        return { error => "no_email" } unless $externalid->{'emailaddr'};
416
        my $emailaddr = $externalid->{'emailaddr'};
417
        my $sendAllEmailsTo = C4::Context->preference('SendAllEmailsTo');
418
        $emailaddr = $sendAllEmailsTo if ($sendAllEmailsTo && $sendAllEmailsTo =~ /@/ ); # some validation.  This could be improved.
419
        # ... then send mail
409
        my %mail = (
420
        my %mail = (
410
                To      =>     $externalid->{'emailaddr'},
421
                To      => $emailaddr,
411
                From    =>  $branchdetails->{'branchemail'} || C4::Context->preference("KohaAdminEmailAddress"),
422
                From    =>  $branchdetails->{'branchemail'} || C4::Context->preference("KohaAdminEmailAddress"),
412
                Subject => Encode::encode( "utf8", $letter->{'title'} ),
423
                Subject => Encode::encode( "utf8", $letter->{'title'} ),
413
                Message => Encode::encode( "utf8", $letter->{'content'} ),
424
                Message => Encode::encode( "utf8", $letter->{'content'} ),
(-)a/basket/sendbasket.pl (+2 lines)
Lines 44-50 my ( $template, $borrowernumber, $cookie ) = get_template_and_user ( Link Here
44
);
44
);
45
45
46
my $bib_list     = $query->param('bib_list');
46
my $bib_list     = $query->param('bib_list');
47
my $sendAllEmailsTo = C4::Context->preference('SendAllEmailsTo');
47
my $email_add    = $query->param('email_add');
48
my $email_add    = $query->param('email_add');
49
$email_add = $sendAllEmailsTo if ($sendAllEmailsTo && $sendAllEmailsTo =~ /@/ ); # some validation.  This could be improved.
48
my $email_sender = $query->param('email_sender');
50
my $email_sender = $query->param('email_sender');
49
51
50
my $dbh          = C4::Context->dbh;
52
my $dbh          = C4::Context->dbh;
(-)a/misc/cronjobs/runreport.pl (+2 lines)
Lines 179-184 if ($to or $from or $email) { Link Here
179
    $from or $from = C4::Context->preference('KohaAdminEmailAddress');
179
    $from or $from = C4::Context->preference('KohaAdminEmailAddress');
180
    $to   or $to   = C4::Context->preference('KohaAdminEmailAddress');
180
    $to   or $to   = C4::Context->preference('KohaAdminEmailAddress');
181
}
181
}
182
my $sendAllEmailsTo = C4::Context->preference('SendAllEmailsTo');
183
$to = $sendAllEmailsTo if ($sendAllEmailsTo && $sendAllEmailsTo =~ /@/ ); # some validation.  This could be improved.
182
184
183
unless (scalar(@ARGV)) {
185
unless (scalar(@ARGV)) {
184
    print STDERR "ERROR: No reportID(s) specified\n";
186
    print STDERR "ERROR: No reportID(s) specified\n";
(-)a/opac/opac-sendbasket.pl (+2 lines)
Lines 47-53 my ( $template, $borrowernumber, $cookie ) = get_template_and_user ( Link Here
47
);
47
);
48
48
49
my $bib_list     = $query->param('bib_list');
49
my $bib_list     = $query->param('bib_list');
50
my $sendAllEmailsTo = C4::Context->preference('SendAllEmailsTo');
50
my $email_add    = $query->param('email_add');
51
my $email_add    = $query->param('email_add');
52
$email_add = $sendAllEmailsTo if ($sendAllEmailsTo && $sendAllEmailsTo =~ /@/ ); # some validation.  This could be improved.
51
my $email_sender = $query->param('email_sender');
53
my $email_sender = $query->param('email_sender');
52
54
53
my $dbh          = C4::Context->dbh;
55
my $dbh          = C4::Context->dbh;
(-)a/opac/opac-sendshelf.pl (+2 lines)
Lines 47-53 my ( $template, $borrowernumber, $cookie ) = get_template_and_user ( Link Here
47
);
47
);
48
48
49
my $shelfid = $query->param('shelfid');
49
my $shelfid = $query->param('shelfid');
50
my $sendAllEmailsTo = C4::Context->preference('SendAllEmailsTo');
50
my $email   = $query->param('email');
51
my $email   = $query->param('email');
52
$email = $sendAllEmailsTo if ($sendAllEmailsTo && $sendAllEmailsTo =~ /@/ ); # some validation.  This could be improved.
51
53
52
my $dbh          = C4::Context->dbh;
54
my $dbh          = C4::Context->dbh;
53
55
(-)a/virtualshelves/sendshelf.pl (-1 / +2 lines)
Lines 46-52 my ( $template, $borrowernumber, $cookie ) = get_template_and_user ( Link Here
46
);
46
);
47
47
48
my $shelfid = $query->param('shelfid');
48
my $shelfid = $query->param('shelfid');
49
my $sendAllEmailsTo = C4::Context->preference('SendAllEmailsTo');
49
my $email   = $query->param('email');
50
my $email   = $query->param('email');
51
$email = $sendAllEmailsTo if ($sendAllEmailsTo && $sendAllEmailsTo =~ /@/ ); # some validation.  This could be improved.
50
52
51
my $dbh          = C4::Context->dbh;
53
my $dbh          = C4::Context->dbh;
52
54
53
- 

Return to bug 8000