NAME

DADA::Mail::MailOut - Helps Monitor a Mass Mailout


VERSION

Refer to the version of Dada Mail that this module comes in.


SYNOPSIS

    # A few subroutines, exported by default: 
    
    my @mailouts  = DADA::Mail::MailOut::current_mailouts($list);  
 
    my $exists    = DADA::Mail::MailOut::mailout_exists($list, $id, $type); 
    
 
 
     
    # Create a new DADA::Mail::MailOut object: 
    my $mailout = DADA::Mail::MailOut->new(-List => $list); 
    
    # Make a new Mailout: 
    $mailout->create(
                    -fields   => {%fields},
                    -list_type => 'list',
                    -mh_obj    => $mh_obj,  
               ); 
    
    # how's that mailout doin'?
    my $status = $mailout->status; 
    
    # do I need to reload the mailout? 
    my $yes_restart = $mailout->should_be_restarted; 
    
    # if so, let's do that: 
    if($yes_restart){ 
        $mailout->reload('list');  
    }


DESCRIPTION

This module does a few things, all of which happen to deal with setting up a mass mailing and then monitoring its status.

Mass Mailings do take a while and the CGI environment that Dada Mail is run in, isn't the best thing to be in during a long-running process, like mail sending to a few thousand of your closest friends.

Because of that, this module attempts to keep close track of how the mailing is doing and give an option to reload a mailing at the time it stopped. Mailings usually stop because the mailing process itself can be killed by the server itself.

The create() method does most of the magic in getting a mailing setup. When called correctly, it will make a temporary directory (usually in $TMP that holds within it the following files:


SUBROUTINES/METHODS

new

Takes one argument - the list shortname, ala:

    my $mailout = DADA::Mail::MailOut->new({-List => 'listshortname'});

All there is to it.

Note! that a MailOut object is pretty useless, until you call the, create() method.

create

Used to setup, or, ``create'' a mailout. Makes all the temporary files and directories need. Needs a few things passed - do pay attention, since what it needs is slightly odd:

 $mailout->create(
                    -fields   => {%fields},
                    -list_type => 'list',
                    -mh_obj    => $mh_obj,  
               );

You'll most likely never call create() yourself, but that's the jist of it.

status

Although you may never call create, calling status may be much more commonplace.

 my $status = $mailout->status;

or even:

foreach(keys %{$mailout->status}){ print $_; # or... something... }

status returns a hashref of various information about your mailout. Best not to call this too many times at once, as it does query all those temporary files we've created. I'll go over what you're most likely going to use:


DIAGNOSTICS


BUGS AND LIMITATIONS

Please report problems to the author of this module


AUTHOR

Justin Simoni

See: http://mojo.skazat.com/contact


LICENCE AND COPYRIGHT

Copyright (c) 2006 Justin Simoni All rights reserved.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.