Action mailer rails 6
cannot send email from console using UserMailer.welcome_email.perform_now, geting this error
Traceback (most recent call last): 1: from (irb):3 NameError (uninitialized constant UserMailer irb(main):004:0>
why is it saying (uninitialized constant UserMailer)
Is the filename correct for that file? Maybe a typo somewhere? it's usually something as simple as that.
cannot send email from console using in rails 6
Traceback (most recent call last):
2: from (irb):2
1: from (irb):2:in `rescue in irb_binding'
NameError (uninitialized constant EmailMailer)
class EmailMailer < ApplicationMailer
@greeting = "Hi"
mail to: my_email_address
I'm having the same problem in Rails 6.0.2. After generating a mailer UserMailer, running it in console results the following:
irb(main):001:0> UserMailer Traceback (most recent call last): 1: from (irb):1 NameError (uninitialized constant UserMailer)
I've checked the file names and everything is named correction (user_mailer.rb and the class is UserMailer).
Oddly enough, running ApplicationMailer in the console is recognised.
irb(main):003:0> ApplicationMailer => ApplicationMailer
Has something changed since rails 5 where you can't run mailer actions from the console?