Fixed bug #249
This commit is contained in:
parent
7d978c4df1
commit
87f7a050ab
2 changed files with 9 additions and 3 deletions
|
@ -125,7 +125,12 @@ router.post('/subscribe/:listId', (req, res) => {
|
|||
}
|
||||
|
||||
if (/^(yes|true|1)$/i.test(input.REQUIRE_CONFIRMATION)) {
|
||||
confirmations.addConfirmation(list.id, 'subscribe', req.ip, subscription, (err, confirmCid) => {
|
||||
const data = {
|
||||
email: subscription.email,
|
||||
subscriptionData: subscription
|
||||
};
|
||||
|
||||
confirmations.addConfirmation(list.id, 'subscribe', req.ip, data, (err, confirmCid) => {
|
||||
if (err) {
|
||||
log.error('API', err);
|
||||
res.status(500);
|
||||
|
|
|
@ -77,6 +77,7 @@ router.get('/confirm/subscribe/:cid', (req, res, next) => {
|
|||
let optInCountry = geoip.lookupCountry(confirmation.ip) || null;
|
||||
|
||||
const meta = {
|
||||
cid: req.params.cid,
|
||||
email: data.email,
|
||||
optInIp: confirmation.ip,
|
||||
optInCountry,
|
||||
|
@ -438,7 +439,7 @@ router.post('/:cid/subscribe', passport.parseForm, corsOrCsrfProtection, (req, r
|
|||
log.info('Subscription', 'Confirmation message for %s marked to be skipped (%s)', email, JSON.stringify(data));
|
||||
sendWebResponse();
|
||||
} else {
|
||||
mailHelpers.sendConfirmSubscription(list, email, confirmCid, data, (err) => {
|
||||
mailHelpers.sendConfirmSubscription(list, email, confirmCid, subscriptionData, (err) => {
|
||||
if (err) {
|
||||
return req.xhr ? sendJsonError(err) : sendWebResponse(err);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue