Commit 1e6644f5 authored by Julian Maurice's avatar Julian Maurice Committed by Paul Poulain

Bug 6090: Do not enqueue empty messages

This patch avoid enqueuing messages that have an empty body. It can
happen when letter is empty or becomes empty after being processed by
Signed-off-by: default avatarKyle M Hall <>
Signed-off-by: default avatarPaul Poulain <>
parent a78298d2
......@@ -672,6 +672,13 @@ sub EnqueueLetter ($) {
return unless exists $params->{'borrowernumber'};
return unless exists $params->{'message_transport_type'};
my $content = $params->{letter}->{content};
$content =~ s/\s+//g if(defined $content);
if ( not defined $content or $content eq '' ) {
warn "Trying to add an empty message to the message queue" if $debug;
# If we have any attachments we should encode then into the body.
if ( $params->{'attachments'} ) {
$params->{'letter'} = _add_attachments(
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment