Stop generation of unnecessary warning messages to log over undef values

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Henri-Damien LAURENT <henridamien.laurent@biblibre.com>
This commit is contained in:
Colin Campbell 2009-07-22 18:07:30 +01:00 committed by Henri-Damien LAURENT
parent 1358afe701
commit 4a30bccba9
1 changed files with 18 additions and 10 deletions

View File

@ -400,18 +400,26 @@ sub SendAlerts {
# ... then send mail
if ( $databookseller->{bookselleremail}
|| $databookseller->{contemail} )
{
|| $databookseller->{contemail} ) {
my $mail_to = $databookseller->{bookselleremail};
if ($databookseller->{contemail}) {
if (!$mail_to) {
$mail_to = $databookseller->{contemail};
} else {
$mail_to .= q|,|;
$mail_to .= $databookseller->{contemail};
}
}
my $mail_subj = $innerletter->{title};
my $mail_msg = $innerletter->{content};
$mail_msg ||= q{};
$mail_subj ||= q{};
my %mail = (
To => $databookseller->{bookselleremail}
. (
$databookseller->{contemail}
? "," . $databookseller->{contemail}
: ""
),
To => $mail_to,
From => $userenv->{emailaddress},
Subject => "" . $innerletter->{title},
Message => "" . $innerletter->{content},
Subject => $mail_subj,
Message => $mail_msg,
'Content-Type' => 'text/plain; charset="utf8"',
);
sendmail(%mail);