Module Engines::RailsExtensions::ActionMailer
In: lib/engines/rails_extensions/action_mailer.rb

The way ActionMailer is coded in terms of finding templates is very restrictive, to the point where all templates for rendering must exist under the single base path. This is difficult to work around without re-coding significant parts of the action mailer code.


The MailTemplates module overrides two (private) methods from ActionMailer to enable mail templates within plugins:

template_path
which now produces the contents of template_paths
initialize_template_class
which now find the first matching template and creates an ActionVew::Base instance with the correct view_paths

Ideally ActionMailer would use the same template-location logic as ActionView, and the same view paths as ActionController::Base.view_paths, but it currently does not.

[Validate]