Rails mailer and mailer views in subfolder not working
actionmailer, ruby-on-rails, ruby-on-rails-3
Solution
I came back to this project today and it seems to be finding the template today no problem without having to specify the template_path.
As sad as this is, apparently all I needed to do was stop and restart my server for my mailer views to get picked up. Since other views get picked up without stopping and starting my server, i'm very surprised by this.
Problem
I have a mailer that I can see in my log is getting sent, but the email body does not contain anything from the mailer view. It's due to the fact that I've put things in subfolders and i've tried using `:template_path` in my `mail` function but to no avail. app/mailers/marketing/marketing_mailer.rb ``` class Marketing::MarketingMailer < ActionMailer::Base require 'mail' address = Mail::Address.new "test@example.com" # ex: "john@example.com" address.display_name = "Text" # ex: "John Doe" # Set the From or Reply-To header to the following: address.format # returns "John Doe <john@example.com>" default from: address # Sends an email when someone fills out the contact form def contact(name, email, message) @name = name @email = email @message = message mail(:subject => "Test", :to => 'test@example.com', :reply_to => @email) # <== I've tried using :template_path => 'marketing', 'marketing/marketing_mailer', etc, but none worked. end end ``` /app/views/marketing/marketing_mailer/contact.html.erb ``` <!DOCTYPE html> <html> <head> <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> </head> <body> <p>Name: <%= @name %></p> <p>Email: <%= @email %></p> <p>Message: <%= @message %></p> </body> </html> ``` I noticed that devise has mailer views inside /views/devise/mailers/... so I know it's possible, but i'm not sure how.