views:

37

answers:

1

I had previously a mailer set up to send me emails to all user accounts. But now I'm trying to debug it. So I gutted it out completely and it still sends emails to me.

I have absolutely no reasoning or understanding as to why. Insanity! :D

controller

def org_blast_send
  Delayed::Job.enqueue OrgBlast.new(params[:subject], params[:editor1])
  redirect_to org_blast_admin_email_blast_path
end

org_blast.rb

class OrgBlast < Struct.new(:subject, :editor1)
  def perform
    # You see? There is absolute nothing here but it still sends an email.
    # However, if I rename this file, the website fails looking for it.
  end
end

notifier.rb

def org_blast(org, subject, message)
  subject subject
  from NOTIFIER_EMAIL
  recipients org.users.first.email
  sent_on Time.zone.now
  body :user => org.users.first.first_name + ' ' + org.users.first.last_name, :message => message
  content_type  "text/html"
end
+1  A: 

If you are running delayed_jobs on your local, it must be stopped and restarted or it will despite your code do whatever was in your code the last time it was started.

>> script/delayed_job stop
>> script/delayed_job start
Trip
+1 because it sometimes helps understanding the problem when asking the question ;-)
hurikhan77
...and sometimes asking the question helps you understand the problem!
zetetic
I'm working on a web application that will tell you what you say to yourself from the future. That way all the answers are way more personalized. Know of any ruby gems that work with quantum physics and time expansion?
Trip