I am using Sidekiq to deliver my emails asynchronously but have had persistent errors about not being able to find the email template. It isn't consistent as it works from time to time (like when I'm testing). You can see that I have even tried specifying the path and name of the template.
The error I am receiving in Honeybadger is: ActionView::MissingTemplate: Missing template signup_mailer/welcome_message with "mailer". Searched in: * "signup_mailer"
app/mailers/signup_mailer.rb
class SignupMailer < ActionMailer::Base
default from: '[email protected]'
def welcome_message(company, user)
@company = company
@user = user
@web_url = root_url
mail(to: @company.email, subject: 'Welcome to CompanyCam', template_path: 'signup_mailer', template_name: 'welcome_message')
end
end
You can see in the picture that there is in fact a view called welcome_message.html.erb
and the text version as well located in app/views/signup_mailer/
mail(to: @company.email, subject: 'Welcome to CompanyCam', template_path: 'signup_mailer', template_name: 'welcome_message') => to mail(to: @company.email, subject: 'Welcome to CompanyCam')
– UndersignedSignupMailer.welcome_message(random_company, random_user)
– Weakswelcome_message.html.erb.rb
but then I fixed it. Do you have gems likehaml
which may break the render oferb file
? – Weakstemplate_name
is not being considered. – Smoothie