socialforge/config/initializers/send_mail.rb

16 lines
349 B
Ruby

#coding=utf-8
## 移入crontab
# scheduler = Rufus::Scheduler.new
#
# #每天18:00发送当天的邮件汇总
# scheduler.cron('0 18 * * *') do
# users = User.where(mail_notification: 'day')
# users.each do |user|
# mailer = Mailer.send_for_user_activities(user, Date.today, 1)
# mailer.deliver if mailer
# end
# end