From 1056adaad078d80a88b7cc15adb4bd3e307ca1ea Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 5 Sep 2013 12:46:06 -0400 Subject: [PATCH] Bug 5544: (follow-up) avoid warning if notice is not directed at a patron Signed-off-by: Marcel de Rooy Signed-off-by: Galen Charlton --- C4/Letters.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/C4/Letters.pm b/C4/Letters.pm index bb327a2812..be2913f966 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -945,9 +945,12 @@ sub _send_message_by_email { my $content = encode('utf8', $message->{'content'}); my $content_type = $message->{'content_type'} || 'text/plain; charset="UTF-8"'; my $is_html = $content_type =~ m/html/io; + + my $branch_email = ( $member ) ? GetBranchDetail( $member->{'branchcode'} )->{'branchemail'} : undef; + my %sendmail_params = ( To => $to_address, - From => $message->{'from_address'} || GetBranchDetail( $member->{'branchcode'} )->{'branchemail'} || C4::Context->preference('KohaAdminEmailAddress'), + From => $message->{'from_address'} || $branch_email || C4::Context->preference('KohaAdminEmailAddress'), Subject => $subject, charset => 'utf8', Message => $is_html ? _wrap_html($content, $subject) : $content, -- 2.39.5