Reduced transactional email sends a bit.

This commit is contained in:
Nick Winter 2015-04-27 15:06:26 -07:00
parent 2e43b18857
commit a4964ea36e
2 changed files with 10 additions and 8 deletions
server

View file

@ -542,7 +542,8 @@ handleLadderUpdate = (req, res) ->
res.send('Great work, Captain Cron! I can take it from here.')
res.end()
# TODO: somehow fetch the histograms
emailDays = [1, 2, 4, 7, 14, 30]
#emailDays = [1, 2, 4, 7, 14, 30]
emailDays = [1, 3, 7] # Reduced to keep smaller monthly recipient footprint
now = new Date()
for daysAgo in emailDays
# Get every session that was submitted in a 5-minute window after the time.

View file

@ -209,13 +209,14 @@ UserSchema.methods.register = (done) ->
@set 'name', uniqueName
done()
else done()
data =
email_id: sendwithus.templates.welcome_email
recipient:
address: @get 'email'
sendwithus.api.send data, (err, result) ->
log.error "sendwithus post-save error: #{err}, result: #{result}" if err
delighted.addDelightedUser @
if @isEmailSubscriptionEnabled 'generalNews'
data =
email_id: sendwithus.templates.welcome_email
recipient:
address: @get 'email'
sendwithus.api.send data, (err, result) ->
log.error "sendwithus post-save error: #{err}, result: #{result}" if err
delighted.addDelightedUser @
@saveActiveUser 'register'
UserSchema.methods.isPremium = ->