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
parseletter
Signed-off-by: default avatarKyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: default avatarPaul Poulain <paul.poulain@biblibre.com>
parent a78298d2
...@@ -672,6 +672,13 @@ sub EnqueueLetter ($) { ...@@ -672,6 +672,13 @@ sub EnqueueLetter ($) {
return unless exists $params->{'borrowernumber'}; return unless exists $params->{'borrowernumber'};
return unless exists $params->{'message_transport_type'}; 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;
return;
}
# If we have any attachments we should encode then into the body. # If we have any attachments we should encode then into the body.
if ( $params->{'attachments'} ) { if ( $params->{'attachments'} ) {
$params->{'letter'} = _add_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