Skip to content

Commit

Permalink
allow for namespaced mailers
Browse files Browse the repository at this point in the history
  • Loading branch information
licatajustin committed Mar 18, 2016
1 parent 37eac8f commit dad8b7b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/inline_styles_mailer.rb
Expand Up @@ -72,7 +72,8 @@ def mail(options, &block)
}.each do |template|
# templates.each do |template|
# e.g. template = app/views/user_mailer/welcome.html.erb
template_path = template.inspect.split("/").slice(-2, 2).join("/") # e.g. user_mailer/welcome.html.erb
# e.g. template = app/views/namespace/user_mailer/welcome.html.erb
template_path = template.inspect.split("views")[1][1..-1] # e.g. user_mailer/welcome.html.erb
parts = template_path.split('.')
handler = parts.pop.to_sym # e.g. erb
extension = parts.pop.to_sym # e.g. html
Expand Down

0 comments on commit dad8b7b

Please sign in to comment.