[siesta-commit] siesta/lib Siesta.pm,1.18,1.19

[prev] [thread] [next] [lurker] [Date index for 2002/09/12]

From: muttley
Subject: [siesta-commit] siesta/lib Siesta.pm,1.18,1.19
Date: 16:28 on 12 Sep 2002
Update of /cvsroot/siesta/siesta/lib
In directory usw-pr-cvs1:/tmp/cvs-serv10184/lib

Modified Files:
	Siesta.pm 
Log Message:
New Sender API


Index: Siesta.pm
===================================================================
RCS file: /cvsroot/siesta/siesta/lib/Siesta.pm,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- Siesta.pm	10 Sep 2002 18:23:16 -0000	1.18
+++ Siesta.pm	12 Sep 2002 15:28:15 -0000	1.19
@@ -77,6 +77,53 @@
     $storage;
 }
 
+my $sender;
+
+=item ->sender 
+
+Return the current sender.
+
+The default is Siesta::Send::Sendmail.
+
+See B<set_sender> for other details.
+
+=cut
+
+sub sender {
+
+    unless ( defined $sender ) {
+        Siesta->set_sender('Sendmail');
+    }
+
+    return $sender;
+}
+
+=item ->set_sender ($class, @options)
+
+Set the current sender to the given class. 
+This will pass on any options you give it automatically.
+
+=cut
+
+sub set_sender {
+    my $self  = shift;
+    my $class = shift;
+    return unless $class;
+
+    $class = "Siesta::Send::$class";
+    print "$class\n" if debug;
+    eval "require $class";
+    die $@ if $@;
+    $sender = $class->new(@_);
+
+}
+
+=item ->list_all_plugins
+
+List every plugin available to the system.
+
+=cut
+
 sub list_all_plugins {
     my @dirs;
 



Generated at 13:57 on 01 Jul 2004 by mariachi 0.52