Last Updated: February 25, 2016
·
3.197K
· rbmrclo

[ActionMailer] method`.deliver` is already deprecated, use this instead.

I know that this might be too early for a sudden update of your code but it could be a good practice to start using .deliver_now or .deliver_later on your projects when using ActionMailer since .deliver is already deprecated.

# Source: https://github.com/rails/rails/blob/master/actionmailer/lib/action_mailer/message_delivery.rb#L85-L95

def deliver! #:nodoc:
  ActiveSupport::Deprecation.warn "#deliver! is deprecated and will be removed in Rails 5. " \ "Use #deliver_now! to deliver immediately or #deliver_later! to deliver through Active Job."
  deliver_now!
end

def deliver #:nodoc:
  ActiveSupport::Deprecation.warn "#deliver is deprecated and will be removed in Rails 5. " \ "Use #deliver_now to deliver immediately or #deliver_later to deliver through Active Job."
  deliver_now
 end