Upgrade to rails 6.1.7.1 does not recognize the ActionMailer subclass in environments config

28 Views Asked by At

After upgrading our app from rails 5.2.8.1 to rails 6.1.7.1, the ActionMailer subclasses are not recognized in environments config.

This is the error we recieved: uninitialized constant BulkMailer (NameError) Error

Here are the setup details:

config/environments/development.rb

config.action_mailer.delivery_method = :smtp
  config.action_mailer.smtp_settings = {
    :user_name => 'myname',
    :password => 'mypass',
    :domain => 'mydomain',
    :address => 'smtp.sendgrid.net',
    :port => 587,
    :authentication => :plain
  }
  
  BulkMailer.smtp_settings = {
    :user_name => 'myname',
    :password => 'mypass',
    :domain => 'mydomain',
    :address => 'smtp.sendgrid.net',
    :port => 587,
    :authentication => :plain
  }

Bulk Mailer:

class BulkMailer < ApplicationMailer
...
end

ApplicationMailer:

class ApplicationMailer < ActionMailer::Base
...
end

How can we resolve this issue?

Thank you!

0

There are 0 best solutions below