Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

roadie_mail not picking up template_path #76

Open
zhoujeffrey opened this issue Aug 24, 2017 · 2 comments
Open

roadie_mail not picking up template_path #76

zhoujeffrey opened this issue Aug 24, 2017 · 2 comments

Comments

@zhoujeffrey
Copy link

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:

  • "/Users/jz/Documents/Github/SmallDollar/app/views"
@Mange
Copy link
Owner

Mange commented Aug 24, 2017

What do you get when you run this command?

find /Users/jz/Documents/Github/SmallDollar/app/views

@zhoujeffrey
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants