feat(weekly-recap): enable for new users who sign in

This commit is contained in:
Matteo Pagliazzi
2015-06-16 11:15:03 +02:00
parent ecb2544cdc
commit a82270fbaa

View File

@@ -516,6 +516,11 @@ UserSchema.pre('save', function(next) {
this.achievements.triadBingo = true; this.achievements.triadBingo = true;
} }
// Enable weekly recap emails for old users who sign in
if(!this.flags.lastWeeklyRecap){
this.flags.lastWeeklyRecap = moment().subtract(6, 'days').toDate();
}
// EXAMPLE CODE for allowing all existing and new players to be // EXAMPLE CODE for allowing all existing and new players to be
// automatically granted an item during a certain time period: // automatically granted an item during a certain time period:
// if (!this.items.pets['JackOLantern-Base'] && moment().isBefore('2014-11-01')) // if (!this.items.pets['JackOLantern-Base'] && moment().isBefore('2014-11-01'))