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

(-)a/C4/Letters.pm (-5 / +6 lines)
Lines 912-920 sub EnqueueLetter { Link Here
912
    my $dbh       = C4::Context->dbh();
912
    my $dbh       = C4::Context->dbh();
913
    my $statement = << 'ENDSQL';
913
    my $statement = << 'ENDSQL';
914
INSERT INTO message_queue
914
INSERT INTO message_queue
915
( borrowernumber, subject, content, metadata, letter_code, message_transport_type, status, time_queued, to_address, from_address, content_type )
915
( borrowernumber, subject, content, metadata, letter_code, message_transport_type, status, time_queued, to_address, from_address, reply_address, content_type )
916
VALUES
916
VALUES
917
( ?,              ?,       ?,       ?,        ?,           ?,                      ?,      NOW(),       ?,          ?,            ? )
917
( ?,              ?,       ?,       ?,        ?,           ?,                      ?,      NOW(),       ?,          ?,            ?,           ? )
918
ENDSQL
918
ENDSQL
919
919
920
    my $sth    = $dbh->prepare($statement);
920
    my $sth    = $dbh->prepare($statement);
Lines 928-933 ENDSQL Link Here
928
        'pending',                                # status
928
        'pending',                                # status
929
        $params->{'to_address'},                  # to_address
929
        $params->{'to_address'},                  # to_address
930
        $params->{'from_address'},                # from_address
930
        $params->{'from_address'},                # from_address
931
        $params->{'reply_address'},               # reply_address
931
        $params->{'letter'}->{'content-type'},    # content_type
932
        $params->{'letter'}->{'content-type'},    # content_type
932
    );
933
    );
933
    return $dbh->last_insert_id(undef,undef,'message_queue', undef);
934
    return $dbh->last_insert_id(undef,undef,'message_queue', undef);
Lines 1124-1130 sub GetMessage { Link Here
1124
    return unless $message_id;
1125
    return unless $message_id;
1125
    my $dbh = C4::Context->dbh;
1126
    my $dbh = C4::Context->dbh;
1126
    return $dbh->selectrow_hashref(q|
1127
    return $dbh->selectrow_hashref(q|
1127
        SELECT message_id, borrowernumber, subject, content, metadata, letter_code, message_transport_type, status, time_queued, updated_on, to_address, from_address, content_type
1128
        SELECT message_id, borrowernumber, subject, content, metadata, letter_code, message_transport_type, status, time_queued, updated_on, to_address, from_address, reply_address, content_type
1128
        FROM message_queue
1129
        FROM message_queue
1129
        WHERE message_id = ?
1130
        WHERE message_id = ?
1130
    |, {}, $message_id );
1131
    |, {}, $message_id );
Lines 1228-1234 sub _get_unsent_messages { Link Here
1228
1229
1229
    my $dbh = C4::Context->dbh();
1230
    my $dbh = C4::Context->dbh();
1230
    my $statement = qq{
1231
    my $statement = qq{
1231
        SELECT mq.message_id, mq.borrowernumber, mq.subject, mq.content, mq.message_transport_type, mq.status, mq.time_queued, mq.from_address, mq.to_address, mq.content_type, b.branchcode, mq.letter_code
1232
        SELECT mq.message_id, mq.borrowernumber, mq.subject, mq.content, mq.message_transport_type, mq.status, mq.time_queued, mq.from_address, mq.reply_address, mq.to_address, mq.content_type, b.branchcode, mq.letter_code
1232
        FROM message_queue mq
1233
        FROM message_queue mq
1233
        LEFT JOIN borrowers b ON b.borrowernumber = mq.borrowernumber
1234
        LEFT JOIN borrowers b ON b.borrowernumber = mq.borrowernumber
1234
        WHERE status = ?
1235
        WHERE status = ?
Lines 1314-1320 sub _send_message_by_email { Link Here
1314
                : ()
1315
                : ()
1315
            ),
1316
            ),
1316
            from    => $message->{'from_address'} || $branch_email,
1317
            from    => $message->{'from_address'} || $branch_email,
1317
            replyto => $branch_replyto,
1318
            replyto => $message->{'reply_address'} || $branch_replyto,
1318
            sender  => $branch_returnpath,
1319
            sender  => $branch_returnpath,
1319
            subject => $subject,
1320
            subject => $subject,
1320
            message => $is_html ? _wrap_html( $content, $subject ) : $content,
1321
            message => $is_html ? _wrap_html( $content, $subject ) : $content,
(-)a/opac/opac-issue-note.pl (-2 / +2 lines)
Lines 82-95 if ( $action eq 'issuenote' && C4::Context->preference('AllowCheckoutNotes') ) { Link Here
82
            );
82
            );
83
83
84
            my $to_address = $branch->branchemail || $branch->branchreplyto || C4::Context->ReplytoDefault || C4::Context->preference('KohaAdminEmailAddress');
84
            my $to_address = $branch->branchemail || $branch->branchreplyto || C4::Context->ReplytoDefault || C4::Context->preference('KohaAdminEmailAddress');
85
            my $from_address = $patron->email || $patron->emailpro || $patron->B_email;
85
            my $reply_address = $patron->email || $patron->emailpro || $patron->B_email;
86
86
87
            C4::Letters::EnqueueLetter({
87
            C4::Letters::EnqueueLetter({
88
                letter => $letter,
88
                letter => $letter,
89
                message_transport_type => 'email',
89
                message_transport_type => 'email',
90
                borrowernumber => $patron->borrowernumber,
90
                borrowernumber => $patron->borrowernumber,
91
                to_address => $to_address,
91
                to_address => $to_address,
92
                from_address => $from_address,
92
                reply_address => $reply_address,
93
            });
93
            });
94
        }
94
        }
95
    }
95
    }
(-)a/opac/svc/checkout_notes (-3 / +2 lines)
Lines 92-105 if ($is_ajax) { Link Here
92
                );
92
                );
93
93
94
                my $to_address = $branch->branchemail || $branch->branchreplyto || C4::Context->preference('ReplytoDefault') || C4::Context->preference('KohaAdminEmailAddress');
94
                my $to_address = $branch->branchemail || $branch->branchreplyto || C4::Context->preference('ReplytoDefault') || C4::Context->preference('KohaAdminEmailAddress');
95
                my $from_address = $patron->email || $patron->emailpro || $patron->B_email;
95
                my $reply_address = $patron->email || $patron->emailpro || $patron->B_email;
96
96
97
                C4::Letters::EnqueueLetter({
97
                C4::Letters::EnqueueLetter({
98
                    letter => $letter,
98
                    letter => $letter,
99
                    message_transport_type => 'email',
99
                    message_transport_type => 'email',
100
                    borrowernumber => $patron->borrowernumber,
100
                    borrowernumber => $patron->borrowernumber,
101
                    to_address => $to_address,
101
                    to_address => $to_address,
102
                    from_address => $from_address,
102
                    reply_address => $reply_address,
103
                });
103
                });
104
            } else { # note empty, i.e removed
104
            } else { # note empty, i.e removed
105
                $status = "removed";
105
                $status = "removed";
106
- 

Return to bug 22821