Mandrill + Rails does not dispatch via controller, but dispatches via console

Hi I have a very strange problem. I am setting up the mandrill as per the docs and now I cannot send mail through my controller. It seems they are not even going to develop letters ... But I can send them through the console!

My mail configuration

  config.action_mailer.default_url_options = { :host => 'smtp.mandrillapp.com' }
  config.action_mailer.perform_deliveries = true
  config.action_mailer.delivery_method = :smtp
  config.action_mailer.smtp_settings = {
    :address   => "smtp.mandrillapp.com",
    :port      => 587,
    :enable_starttls_auto => true,
    :user_name => ENV["MANDRILL_USERNAME"],
    :password  => ENV["MANDRILL_APIKEY"],
    :authentication => 'plain',
    :domain => 'yim.mydomain.org',
  }

      

My mailer

class YimMailer < ActionMailer::Base
  default from: "notifier@yim.mydomain.org"

  def welcome_email(user, data)
    @user = user
    @data = data
    mail(to: @user.email, subject: 'Welcome!')
  end
end

      

In my controller

YimMailer.welcome_email(current_user, dummydata).deliver

      

When I execute the same line through the console, it delivers. What could be the problem?

I am using rails 4

+3


source to share


1 answer


I had the same problem and restarted the server (by accident), it started working through the controller too!



0


source







All Articles