Lines 922-934
sub EnqueueLetter {
Link Here
|
922 |
my $dbh = C4::Context->dbh(); |
922 |
my $dbh = C4::Context->dbh(); |
923 |
my $statement = << 'ENDSQL'; |
923 |
my $statement = << 'ENDSQL'; |
924 |
INSERT INTO message_queue |
924 |
INSERT INTO message_queue |
925 |
( borrowernumber, subject, content, metadata, letter_code, message_transport_type, status, time_queued, to_address, from_address, reply_address, content_type, failure_code ) |
925 |
( letter_id, borrowernumber, subject, content, metadata, letter_code, message_transport_type, status, time_queued, to_address, from_address, reply_address, content_type, failure_code ) |
926 |
VALUES |
926 |
VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, CAST(NOW() AS DATETIME), ?, ?, ?, ?, ? ) |
927 |
( ?, ?, ?, ?, ?, ?, ?, CAST(NOW() AS DATETIME), ?, ?, ?, ?, ? ) |
|
|
928 |
ENDSQL |
927 |
ENDSQL |
929 |
|
928 |
|
930 |
my $sth = $dbh->prepare($statement); |
929 |
my $sth = $dbh->prepare($statement); |
931 |
my $result = $sth->execute( |
930 |
my $result = $sth->execute( |
|
|
931 |
$params->{letter}->{id} || undef, # letter.id |
932 |
$params->{'borrowernumber'}, # borrowernumber |
932 |
$params->{'borrowernumber'}, # borrowernumber |
933 |
$params->{'letter'}->{'title'}, # subject |
933 |
$params->{'letter'}->{'title'}, # subject |
934 |
$params->{'letter'}->{'content'}, # content |
934 |
$params->{'letter'}->{'content'}, # content |