This commit is contained in:
Matteo Pagliazzi 2015-04-07 16:07:52 +02:00
parent d21fb41aef
commit f12f2b201a
2 changed files with 3 additions and 4 deletions

View file

@ -625,7 +625,6 @@ var inviteByEmails = function(invites, group, req, res, next){
// TODO implement "users can only be invited once"
// Check for the email address not to be unsubscribed
EmailUnsubscription.findOne({email: invite.email}, function(err, unsubscribed){
if(err) return cb(err);
if(unsubscribed) return cb();
@ -633,7 +632,7 @@ var inviteByEmails = function(invites, group, req, res, next){
utils.txnEmail(invite, ('invite-friend' + (group.type == 'guild' ? '-guild' : '')), variables);
cb();
})
});
});
}else{
cb();

View file

@ -73,8 +73,8 @@ module.exports.txnEmail = function(mailingInfoArray, emailType, variables, perso
});
// Personal variables are personal to each email recipient, if they are missing
// we manually create a structure for them with RECIPIENT_NAME and RECIPIENT_ID
// otherwise we just add RECIPIENT_NAME and RECIPIENT_ID to the existing personal variables
// we manually create a structure for them with RECIPIENT_NAME and RECIPIENT_UNSUB_URL
// otherwise we just add RECIPIENT_NAME and RECIPIENT_UNSUB_URL to the existing personal variables
if(!personalVariables || personalVariables.length === 0){
personalVariables = mailingInfoArray.map(function(mailingInfo){
return {