-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9191c35
commit 9c9a3c6
Showing
2 changed files
with
2 additions
and
18 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ namespace :entry do | |
# rake entry:send_entries_test | ||
task :send_entries_test => :environment do | ||
user = User.where(:email=>"[email protected]").first | ||
EntryJob.perform_later(user.id, Inspiration.random.id, 0) | ||
EntryMailer.send_entry(user, Inspiration.random).deliver_now | ||
end | ||
|
||
# TRIGGERED MANUALLY | ||
|
@@ -186,7 +186,7 @@ namespace :entry do | |
if user.is_free? && user.emails_sent > 6 && user.entries.count == 0 && ENV['FREE_WEEK'] != 'true' | ||
user.update_columns(frequency: [], previous_frequency: user.frequency) | ||
elsif user.is_pro? || (user.is_free? && Time.now.strftime("%U").to_i % 2 == 0) || ENV['FREE_WEEK'] == 'true' # Every other week for free users | ||
EntryJob.perform_later(user.id, random_inspiration.id, sent_in_hour) | ||
EntryMailer.send_entry(user, random_inspiration).deliver_now | ||
sent_in_hour += 1 | ||
end | ||
rescue => error | ||
|