Forum: Ruby on Rails Send email with delayed job

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
E46593732261d73ee99adc380b7f767a?d=identicon&s=25 Greg Ma (gregorylepacha)
on 2011-01-06 21:46
Hi,
I want to send email with delayed job.
In order to do so, I have a Notifier model with X methods sending
different type of emails.

In the documentation, they suggest to send email like this:
class NewsletterJob < Struct.new(:text, :emails)
    def perform
      emails.each { |e| NewsletterMailer.deliver_text_to_email(text, e)
}
    end
  end


But in my notifier model I have X methods, does it mean I have to create
a different Struc for each methods?

Greg
C2b69b81423cc41257b4afa40d860a09?d=identicon&s=25 djangst (Guest)
on 2011-01-06 21:54
(Received via mailing list)
Dumb question: wouldn't you just change the parameter(s) when you call
enqueue()?
This topic is locked and can not be replied to.