From 5b07fe6af917f645c2eb02ec1b3fba61a0dc3045 Mon Sep 17 00:00:00 2001 From: "Bradley M. Kuhn" Date: Fri, 11 Dec 2015 18:15:31 -0800 Subject: [PATCH] Actual email address add code; tests stay same. --- Supporters/lib/Supporters.pm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Supporters/lib/Supporters.pm b/Supporters/lib/Supporters.pm index 7e2f33e..0fbcc62 100644 --- a/Supporters/lib/Supporters.pm +++ b/Supporters/lib/Supporters.pm @@ -177,6 +177,15 @@ sub addEmailAddress($$$$) { my $addressTypeId = $self->addAddressType($emailAddressType); + my $sth = $self->dbh->prepare("INSERT INTO email_address(email_address, type_id, date_encountered)" . + "VALUES( ?, ?, date('now'))"); + + $self->dbh->begin_work(); + $sth->execute($emailAddress, $addressTypeId); + my $addressId = $self->dbh->last_insert_id("","","",""); + $sth->finish(); + $self->dbh->commit(); + return $addressId; } ######################################################################