mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-27 06:23:41 -04:00
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.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.
|
||||
|
|
|
@ -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 = ->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue