Whenever works for some email but not all

52 views
Skip to first unread message

hacku...@gmail.com

unread,
Apr 20, 2015, 6:47:02 AM4/20/15
to whenev...@googlegroups.com
Hi,

Thanks for your great gem !!

However, I tried to make a weekly email to be sent to all users, but it doesn't send emails in production.

Here is my user.rb

def self.weekly
    @users = User.all
    @users.each do |u|
      UserMailer.weekly(u.email).deliver
    end
  end

# email test
  def self.testing
    @me = "mye...@gmail.com"
    UserMailer.testing(@me).deliver
  end

My user_mailer.rb

def weekly(email)
    mail(
      :to => email,
      :subject => "My title"
      )
  end

  def testing(me)
    @me = me
    mail(
      :to => me,
      :subject => "testons cela"
      )
  end

And my schedule.rb

every :monday, :at => '09:59 am' do
 runner "User.testing"
end

every :monday, :at => '11:30 am' do
  runner "User.weekly"
end

_______

The testing email works, but not the weekly email.

I've updated the crontab properly for all emails (the testing one as well as the weekly one), but the weekly still doesn't work.
I've run it from the rails console and it works, but in production nothing is sent regarding the weekly email (to all users).
The only thing I get is a "You have a mail var/mail/[root]" message when a check heroku logs

Could you help, please?

Many thanks

Javan Makhmali

unread,
Apr 20, 2015, 9:57:29 AM4/20/15
to whenev...@googlegroups.com
As far as I know, Whenever won't work on Heroku at all because it doesn't support cron and instead uses its own scheduler: https://addons.heroku.com/scheduler



--
--
You received this message because you are subscribed to the Google
Groups "Whenever Gem" group and because you're awesome.
To post to this group, send email to whenev...@googlegroups.com
To unsubscribe from this group, send email to
whenever-gem...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/whenever-gem?hl=en
---
You received this message because you are subscribed to the Google Groups "Whenever Gem" group.
To unsubscribe from this group and stop receiving emails from it, send an email to whenever-gem...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages