]> iEval git - app-web-oof.git/blobdiff - lib/App/Web/Oof.pm
Bump version and update Changes
[app-web-oof.git] / lib / App / Web / Oof.pm
index fa256a6965411da2ec9fca71097846d51960f8c0..a0a4451e8ede4b9081dce3fd499e8ea1525ff862 100644 (file)
@@ -6,9 +6,11 @@ use warnings;
 use utf8;
 use parent qw/Plack::Component/;
 
-our $VERSION = '0.000_005';
+our $VERSION = '0.000_006';
 
 use DBIx::Simple;
+use Email::Sender::Simple 'sendmail';
+use Email::Simple;
 use File::Slurp;
 use HTML::TreeBuilder;
 use HTML::Element::Library;
@@ -208,6 +210,14 @@ sub order_app {
                        }
                        $db{$$}->insert(orders => {id => $id, %parms});
                        $db{$$}->commit;
+                       sendmail (Email::Simple->create(
+                               header => [
+                                       From    => $ENV{OOF_EMAIL_FROM},
+                                       To      => $ENV{OOF_EMAIL_TO},
+                                       Subject => "Order $id placed",
+                               ],
+                               body => 'A new order was placed.',
+                       )) if $ENV{OOF_EMAIL_TO};
                } catch {
                        $db{$$}->rollback;
                        $err = [500, ['Content-type', 'text/plain'], ["Error: $_"]]
This page took 0.021268 seconds and 4 git commands to generate.