On Aug 9, 2005, at 2:51 PM, Manuel Holtgrewe wrote:
> Hi
>
> Is it somehow possible to enabled the ActionView helpers in my
> ActionMailer classes? "url_for" seems not to be available in the
> template (my application crashes because the method does not exist).
>
> Using "helper ActionView::Helpers::UrlHelper" in my ActionMailer
> class does not help either.
Currently, url_for is not accessible in mailer classes. The reason is
that url_for requires some infrastructure that is not available in
mailer classes. Until someone submits a patch that changes that, the
only way to take advantage of url_for in mailer classes is to do
something like:
# in the controller
url = url_for(...)
SomeMailer.deliver_some_mail(url)
And then use the passed value to help render the mail.
- Jamis