#!/usr/bin/perl -w

# test transmit module
#
# Version: $Revision: 0.2 $
# Author: Benjamin Oshrin
# Date: $Date: 2003/10/06 22:22:29 $
#
# Copyright (c) 2003
# The Trustees of Columbia University in the City of New York
# Academic Information Systems
# 
# License restrictions apply, see doc/license.html for details.

use strict;
use FindBin;
use lib "$FindBin::Bin/../common";
use Survivor::Transmit;

# Create a new Transmit object.

my $st = new Survivor::Transmit();

my $r = $st->ParseFormattedAlert();

if($r == MODEXEC_OK)
{
    # There can be multiple addresses.

    my $addrs = join(',', @{$st->Data("Address")});

    # It might be necessary to know if two way replies are permitted.
    # This can be found with
    #  if($st->ReplyOK())
    
    # "Transmit" to stdout

    printf("[Notifying $addrs...]\n");
    printf("[Subject: %s]\n", $st->Data("Subject"));
    print $st->Data("Message") . "\n";
}

exit $r;
