Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Allow ActionMailer to use view_paths from plugins

#2031

ActionMailer currently can not find templates provided by plugins/engines because they're neither loaded into the ActionMailer view_paths nor could ActionMailer use them.

The attached patch fixes this.

I've tried to mess as less with ActionMailer as possible but reading the code I totally wonder why there's still such a thing as template_root? Am I missing something important? Otherwise I'd happily look into some refactoring here at some point.

Reported by Sven Fuchs · February 20th, 2009 @ 10:41 PM

State: resolved
Milestone: none
Assigned to: josh josh
Importance: none

Activity

  1. Repository
    Repository
    • State changed from new to resolved

    (from [441e4e22352c8805a882f6a661ab3982dd7eda12]) load plugin view_paths to action_mailer view_paths and make action_mailer use them [#2031 Allow ActionMailer to use view_paths from plugins state:resolved]

    Signed-off-by: Joshua Peek josh@joshpeek.com http://github.com/rails/rails/co...

    February 22nd, 2009 @ 04:42 PM

  2. Jarl Friis
    Jarl Friis

    I have run into a problem on rails 2.3.5 (https://rails.lighthouseapp.com/projects/8995-rails-plugins/tickets/85) that is caused by code comming from this patch.

    The problem is the line

    self.view_paths = []
    

    Which should be

    self.view_paths = ActionView::Base.process_view_paths([])
    

    Please could you fix this problem as it causing problems for exception_notification plugin in 2.3.5

    Currently I have solved the problem with a monkey patch in my environment.rb like this:

    ExceptionNotification::Notifier.view_paths = ActionView::Base.process_view_paths(ExceptionNotification::Notifier.view_paths)
    

    Should I open a new separate bug for this?

    Jarl

    May 7th, 2010 @ 01:12 PM

  3. Jarl Friis
    Jarl Friis
    • Tag set to actionmailer, action_mailer, patch

    Here is a proposed patch agaisnt 2-3-stable branch

    May 7th, 2010 @ 08:48 PM

  4. Eric Butler
    Eric Butler
    • Importance changed from to

    Hey Jarl,

    Perhaps you should open a new ticket for this? It doesn't look like your patch was ever merged, and I ran into this same problem. http://github.com/rails/rails/blob/2-3-stable/actionmailer/lib/acti...

    Eric

    September 3rd, 2010 @ 06:41 PM

  5. Jarl Friis