addEmailAddress: supporter_email_address_mapping

Properly map email address to supporter when email address is added.

Test now passes:
   ok 12 - addSuporter: email address mapping is created on addSupporter() w/ email address included
This commit is contained in:
Bradley M. Kuhn 2015-12-16 18:13:28 -08:00
parent 3f3f8b7090
commit c4668b81d6

View file

@ -194,7 +194,15 @@ sub addEmailAddress($$$$) {
$sth->execute($emailAddress, $addressTypeId);
my $addressId = $self->dbh->last_insert_id("","","","");
$sth->finish();
my $sth = $self->dbh->prepare("INSERT INTO supporter_email_address_mapping" .
"(supporter_id, email_address_id) " .
"VALUES( ?, ?)");
$sth->execute($id, $addressId);
$sth->finish();
$self->_commit();
return $addressId;
}
######################################################################