Thanks Bharat, that was excellent advice. It turns out the real trouble 
is being caused by this line:

Notifier.deliver_newsletter(user, newsletter)

Now, the stack trace looks like this:


NameError in Newsletters#sendmails

Showing notifier/newsletter.text.plain.rhtml where line #3 raised:

undefined local variable or method `user' for 
#<ActionView::Base:0x23df2a0>

Extracted source (around line #3):

1: My Newsletter
2:
3: <%= render :inline => @body %>



I have a Notifier class that looks like this:

class Notifier < ActionMailer::ARMailer
  def newsletter(user, newsletter)
    recipients user.email
    from "MyApp <[EMAIL PROTECTED]>"
    subject newsletter.subject
    body :body => newsletter.body, :user => user
  end
end


...and this is the file the stack trace refers to:

/app/views/notifier/newsletter.text.plain.rhtml:

My Newsletter

<%= render :inline => @body %>


Still - user is not being referenced from this file at all, so why the 
error?

Thanks again,
/ Vahagn
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to