limits musicians in weekly email
this limits the number of users in weekly email to be 20
This commit is contained in:
parent
100e14cad0
commit
550a458c8d
|
|
@ -2,6 +2,7 @@ module JamRuby
|
||||||
class EmailNewMusicianMatch
|
class EmailNewMusicianMatch
|
||||||
|
|
||||||
PER_PAGE = 150
|
PER_PAGE = 150
|
||||||
|
LIMIT = 20
|
||||||
JOINED_WITHIN_DAYS = 7
|
JOINED_WITHIN_DAYS = 7
|
||||||
ACTIVE_WITHIN_DAYS = 30
|
ACTIVE_WITHIN_DAYS = 30
|
||||||
|
|
||||||
|
|
@ -39,7 +40,7 @@ module JamRuby
|
||||||
true, true, 7.days.ago, 6.days.ago).where.not(id: email_sending.sent_user_ids).order("
|
true, true, 7.days.ago, 6.days.ago).where.not(id: email_sending.sent_user_ids).order("
|
||||||
CASE WHEN users.email IN ('#{PRIORITY_RECIPIENTS.map {|str| "\"#{str}\""}.join(',')}')
|
CASE WHEN users.email IN ('#{PRIORITY_RECIPIENTS.map {|str| "\"#{str}\""}.join(',')}')
|
||||||
THEN 0 ELSE 1 END, last_active_at DESC").select("users.*,
|
THEN 0 ELSE 1 END, last_active_at DESC").select("users.*,
|
||||||
GREATEST(updated_at, last_jam_updated_at) AS last_active_at").limit(20)
|
GREATEST(updated_at, last_jam_updated_at) AS last_active_at").limit(LIMIT)
|
||||||
|
|
||||||
AdminMailer.ugly({to: APP_CONFIG.user_match_monitoring_email,
|
AdminMailer.ugly({to: APP_CONFIG.user_match_monitoring_email,
|
||||||
subject:"Weekly user match email sending job started.",
|
subject:"Weekly user match email sending job started.",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue