Mange / roadie-rails

Making HTML emails comfortable for the Rails rockstars
MIT License
367 stars 66 forks source link

roadie_mail not picking up template_path #76

Open zhoujeffrey opened 7 years ago

zhoujeffrey commented 7 years ago

Has anyone encountered this issue with roadie rails? I fear it could just be my ineptitude as a developer but perhaps someone could lend an eye?

Issue: mail option for template_path is not being passed into roadie_mail

Tried it both in the mailer as default :template_path => 'contact_mailer/application/'

and in roadie_mail call two ways

roadie_mail({:template_path => "contact_mailer/application/", :to => ...}) and roadie_mail(:template_path => "contact_mailer/application/", :to => ...)

I get the error ActionView::MissingTemplate: Missing template contact_mailer/approval_notification, base_mailer/approval_notification, application_mailer/approval_notification with {:locale=>[:en], :formats=>[:html], :variants=>[], :handlers=>[:raw, :erb, :html, :builder, :ruby, :coffee, :jbuilder]}. Searched in:

Mange commented 7 years ago

What do you get when you run this command?

find /Users/jz/Documents/Github/SmallDollar/app/views
zhoujeffrey commented 7 years ago

Just the relevant returned items: /Users/jz/Documents/Github/SmallDollar/app/views/contact_mailer /Users/jz/Documents/Github/SmallDollar/app/views/contact_mailer/application /Users/jz/Documents/Github/SmallDollar/app/views/contact_mailer/application/approval_notification.html.erb /Users/jz/Documents/Github/SmallDollar/app/views/contact_mailer/application/approval_notification.text.erb

I can confirm that it does work with original mail call.

A work around that we're using now is to explicitly call the view instead:

roadie_mail(etc.) do |format| format.html {render 'contact_mailer/application/approval_notification'} format.text {render 'contact_mailer/application/approval_notification'} end