[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
CVS Update: fgo.ca
- To: cvs@lists.cleannorth.org
- Subject: CVS Update: fgo.ca
- From: Dan Brosemer <odin@cleannorth.org>
- Date: Mon, 9 Jun 2008 09:13:39 -0401 (EDT)
- List-help: <mailto:cvs-request@lists.cleannorth.org?subject=help>
- List-post: <mailto:cvs@lists.cleannorth.org>
- List-subscribe: <mailto:cvs-request@lists.cleannorth.org?subject=subscribe>
- List-unsubscribe: <mailto:cvs-request@lists.cleannorth.org?subject=unsubscribe>
- Resent-date: Mon, 9 Jun 2008 09:13:43 -0401 (EDT)
- Resent-from: cvs@lists.cleannorth.org
- Resent-message-id: <huccmD.A.Na.dySTIB@skroob.cleannorth.org>
- Resent-sender: cvs-request@lists.cleannorth.org
Log Message:
-----------
Send an email on complete upload.
Modified Files:
--------------
fgo.ca/public_html:
butternut.pl
Revision Data
-------------
Index: butternut.pl
===================================================================
RCS file: /cvs/fgo.ca/public_html/butternut.pl,v
retrieving revision 1.6
retrieving revision 1.7
diff -Lpublic_html/butternut.pl -Lpublic_html/butternut.pl -u -r1.6 -r1.7
--- public_html/butternut.pl
+++ public_html/butternut.pl
@@ -31,6 +31,7 @@
use Archive::Zip qw(:ERROR_CODES :CONSTANTS);
use Spreadsheet::ParseExcel::Simple;
use Data::Dump;
+use Mail::Sendmail;
use strict;
my $gleipnir = new Gleipnir;
@@ -513,6 +514,27 @@
my $template = $gleipnir->template('butternut/results');
$template->param(errors => \@errors, messages => \@messages);
+
+ my $email = $gleipnir->template('butternut/email');
+ $email->param(errors => \@errors, messages => \@messages);
+
+ my %mail = ();
+ my $h = 1;
+ foreach my $l ( split /\n/, $email->output )
+ {
+ if ( $h == 1 )
+ {
+ my ( $key, $value ) = ( $l =~ m/^([^:]+): (.*)/ );
+ $mail{$key} = $value if defined($key) and defined($value);
+ }
+ else
+ {
+ $mail{Message} .= "$l\n";
+ };
+ $h = 0 if $l =~ m/^\s*$/;
+ };
+ sendmail(%mail);
+
return $gleipnir->body($template->output);
};
- Prev by Date: CVS Update: fgo.ca
- Next by Date: CVS Update: fgo.ca
- Previous by thread: CVS Update: fgo.ca
- Next by thread: CVS Update: fgo.ca
- Index(es):