Bug 31627: Add ability to embed the letter id in outgoing email notices
It can be useful to know exactly what template was used to generate a notice. To further this end, it would be useful be able to send the letter id as part of any emails sent out if there is a letter template associated with the message. Test Plan: 1) Apply this patch 2) Restart all the things! 3) Generate an email notice like a checkout notice 4) Inspect the email headers, note the new X-Koha-Template-Id and X-Koha-Message-Id headers! Signed-off-by: Sam Lau <samalau@gmail.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
6e09fb6ad8
commit
aed4a2ec98
1 changed files with 3 additions and 1 deletions
|
@ -1293,7 +1293,7 @@ sub _get_unsent_messages {
|
||||||
|
|
||||||
my $dbh = C4::Context->dbh();
|
my $dbh = C4::Context->dbh();
|
||||||
my $statement = qq{
|
my $statement = qq{
|
||||||
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, mq.failure_code
|
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, mq.failure_code, mq.letter_id
|
||||||
FROM message_queue mq
|
FROM message_queue mq
|
||||||
LEFT JOIN borrowers b ON b.borrowernumber = mq.borrowernumber
|
LEFT JOIN borrowers b ON b.borrowernumber = mq.borrowernumber
|
||||||
WHERE status = ?
|
WHERE status = ?
|
||||||
|
@ -1464,6 +1464,8 @@ sub _send_message_by_email {
|
||||||
$email->create($params);
|
$email->create($params);
|
||||||
} else {
|
} else {
|
||||||
$email = Koha::Email->create($params);
|
$email = Koha::Email->create($params);
|
||||||
|
$email->header('X-Koha-Letter-Id', $message->{letter_id} );
|
||||||
|
$email->header('X-Koha-Message-Id', $message->{id} );
|
||||||
if ($is_html) {
|
if ($is_html) {
|
||||||
$email->html_body( _wrap_html( $content, $subject ) );
|
$email->html_body( _wrap_html( $content, $subject ) );
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue