$now =
isset($now) ?
$now :
(new DateTime())->
format('Y-m-d H:i:s'
);
$added =
$voteConfirmed ?
$this->front->
getParam('optinDate'
) :
$now;
$doubleOptInConfirmed =
$voteConfirmed ?
$now : null;
$mailDataExists =
$this->connection->
fetchColumn( 'SELECT 1 FROM s_campaigns_maildata WHERE email = ? AND groupID = ?',
[ $email,
$groupID,
] );
$request =
$this->front->
ensureRequest();
if (empty($mailDataExists)) { $sql = '
REPLACE INTO s_campaigns_maildata (
email, groupID, salutation, title, firstname,
lastname, street, zipcode, city, added, double_optin_confirmed
)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
';
$this->connection->
executeQuery($sql,
[ $email,