I'm not an expert in ruby but I think the problem is with the AWS library. Specifically with the fact that there is no way to set the return_response setting.
In this file
gems/2.3.0/gems/aws-sdk-rails-1.0.1/lib/aws/rails/mailer.rb
settings is a function hard coded to return an empty hash. And there is no attr_accessor and there is no initialize for it either.
# ActionMailer expects this method to be present and to return a hash.
def settings
{}
end
And in message.rb there you can get the smtp response code only if delivery_method.settings[:return_response] is true.
# This method bypasses checking perform_deliveries and raise_delivery_errors,
# so use with caution.
#
# It still however fires off the interceptors and calls the observers callbacks if they are defined.
#
# Returns self
def deliver!
inform_interceptors
response = delivery_method.deliver!(self)
inform_observers
delivery_method.settings[:return_response] ? response : self
end
But because settings is not accessible, there is no way to get the response.
So maybe it is possible to use a ruby trick like prepend to override the settings method in the aws library, but for now I'm just adding this line to the aws library file.
# ActionMailer expects this method to be present and to return a hash.
def settings
{ :return_response => true }
end