Skip to content

Default options for stylesheet_path and use_stylesheet don't work correctly with mailer classes placed in modules. #11

@ssemakov

Description

@ssemakov

Hi,
Thanks for your work on this gem I found it useful.

Here is one issue with it though. In a case when mailer placed inside of a module default values for stylesheets and stylesheet_path will not be defined correctly.
For instance, if I have
app/mailers/foo/bar_mailer.rb

class Foo::BarMailer < ApplicationMailer
  include InlineStylesMailer
  ...

default value for @stylesheet will be defined as _foo/bar_mailer* and default value for @stylesheet_path will be app/assets/stylesheets. While it seems like it should define default stylesheet name as _bar_mailer* and look for it in app/assets/stylesheets/foo.

I can workaround of this issue by explicitly using stylesheet_path and use_stylesheet, but I think it would be nice to have default options work as expected.

I can submit a PR with a fix if you will be willing to accept it.

In any case thanks for your work on this gem!
-Simon

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions