ruby - Having Issues with Action Mailer Rails -
right working on building mailer feature app built in ruby on rails send message account when hasn't checked in day. forgo sending said email accounts not have check ins enabled.
here code sending email inactive accounts:
def self.inactive_accounts account.all.select |account| yesterday = (1.day.ago.beginning_of_day..1.day.ago.end_of_day) account.check_ins.where(worked_at: yesterday).empty? end
end
def self.notify inactive_accounts.each |account| missingcheckinmailer.missing_check_in(account,1.day.ago).deliver_now end end
what trying figure out start code keeps these emails being sent accounts not have check in enabled.
Comments
Post a Comment