# Copyright 2002-2008 Josh Clark and Global Moxie, LLC. This code cannot be 
# redistributed without permission from globalmoxie.com.  For more
# information, consult your Big Medium license.
#
# $Id: Email.pm 3043 2008-03-31 14:00:38Z josh $

package BigMed::Log::Email;
use strict;
use warnings;
use utf8;
use Log::Dispatch::Email;
use base qw( Log::Dispatch::Email );
use BigMed::Email;
use English qw( -no_match_vars );

sub send_email {
    my $self = shift;
    my %param = @_; #expecting only message parameter

    foreach my $to_email ( @{ $self->{to} } ) {
        BigMed::Email::send_email(
            to => $to_email,
            subject => $self->{subject},
            body => $param{message},
            from => $self->{from} || 'bigmedium@foo.bar',
        ) or warn "Could not send alert email: $OS_ERROR";
    }

    return;
}

1;

