code-and-effect/effective_email_templates

Template error rails 5

naveen1336 opened this issue · 4 comments

ActionView::MissingTemplate (Missing template template_mailer/welcome_email with "mailer". Searched in:

  • "template_mailer"
    ):

DId you run the rake effective_email_templates:import_templates rake task as per https://github.com/code-and-effect/effective_email_templates#creating-email-templates

yes, i have done that but still same error

found a different way i think liquid template is not working with rails 5.
def welcome_email(user)

   @template = Liquid::Template.parse(File.read("#{Rails.root}/app/views/template_mailer/welcome_email.liquid"))
  mail(to: user.email) do |format|
	 	format.html { @template.render('adjective' => 'awesome') }
	 end
end

but the email send contain the --- text --- which is defied welcom.liquid file

good find, nice!

If you want to submit a PR, I'd gladly merge it :)