rev 1330 - trunk/siesta/lib/Template/Plugin

[prev] [thread] [next] [lurker] [Date index for 2003/08/13]

From: richardc
Subject: rev 1330 - trunk/siesta/lib/Template/Plugin
Date: 13:23 on 13 Aug 2003
Author: richardc
Date: 2003-08-13 13:23:03 +0100 (Wed, 13 Aug 2003)
New Revision: 1330

Modified:
   trunk/siesta/lib/Template/Plugin/Siesta.pm
Log:
urgh. duplicate code a little. notify from web interface subscribe


Modified: trunk/siesta/lib/Template/Plugin/Siesta.pm
===================================================================
--- trunk/siesta/lib/Template/Plugin/Siesta.pm	2003-08-13 12:13:55 UTC (rev 1329)
+++ trunk/siesta/lib/Template/Plugin/Siesta.pm	2003-08-13 12:23:03 UTC (rev 1330)
@@ -3,6 +3,7 @@
 use base qw( Template::Plugin Class::Accessor::Fast );
 __PACKAGE__->mk_accessors(qw( errors context success cgi user ));
 use Siesta;
+use Siesta::Message;
 use Siesta::Deferred;
 use CGI ();
 
@@ -106,7 +107,7 @@
     $user->password($pass1);
     $user->update;
 
-    foreach my $list_name (@subscriptions){
+    foreach my $list_name (@subscriptions) {
         #print "list name $list_name";
         my($list) =  Siesta::List->load( $list_name );
         unless ($list) {
@@ -114,6 +115,15 @@
             next;
         }
         $list->add_member($user);
+
+        my $mail = Siesta::Message->new();
+        $mail->reply( to   => $list->owner->email,
+                      subject => 'web subscription',
+                      body => Siesta->bake('subscribe_notify',
+                                           list    => $list,
+                                           user    => $user,
+                                           message => $mail ),
+                     );
     }
     return 1; # success
 }

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