our $VERSION = '0.000_005';
use DBIx::Simple;
+use Email::Sender::Simple 'sendmail';
+use Email::Simple;
use File::Slurp;
use HTML::TreeBuilder;
use HTML::Element::Library;
}
$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: $_"]]