Reduced transactional email sends a bit.
This commit is contained in:
parent
2e43b18857
commit
a4964ea36e
2 changed files with 10 additions and 8 deletions
server
|
@ -542,7 +542,8 @@ handleLadderUpdate = (req, res) ->
|
||||||
res.send('Great work, Captain Cron! I can take it from here.')
|
res.send('Great work, Captain Cron! I can take it from here.')
|
||||||
res.end()
|
res.end()
|
||||||
# TODO: somehow fetch the histograms
|
# 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()
|
now = new Date()
|
||||||
for daysAgo in emailDays
|
for daysAgo in emailDays
|
||||||
# Get every session that was submitted in a 5-minute window after the time.
|
# Get every session that was submitted in a 5-minute window after the time.
|
||||||
|
|
|
@ -209,13 +209,14 @@ UserSchema.methods.register = (done) ->
|
||||||
@set 'name', uniqueName
|
@set 'name', uniqueName
|
||||||
done()
|
done()
|
||||||
else done()
|
else done()
|
||||||
data =
|
if @isEmailSubscriptionEnabled 'generalNews'
|
||||||
email_id: sendwithus.templates.welcome_email
|
data =
|
||||||
recipient:
|
email_id: sendwithus.templates.welcome_email
|
||||||
address: @get 'email'
|
recipient:
|
||||||
sendwithus.api.send data, (err, result) ->
|
address: @get 'email'
|
||||||
log.error "sendwithus post-save error: #{err}, result: #{result}" if err
|
sendwithus.api.send data, (err, result) ->
|
||||||
delighted.addDelightedUser @
|
log.error "sendwithus post-save error: #{err}, result: #{result}" if err
|
||||||
|
delighted.addDelightedUser @
|
||||||
@saveActiveUser 'register'
|
@saveActiveUser 'register'
|
||||||
|
|
||||||
UserSchema.methods.isPremium = ->
|
UserSchema.methods.isPremium = ->
|
||||||
|
|
Reference in a new issue