UserMailer return boolean value


#1

Is it possible to make is UserMailer returns a boolean value depending
on whether an email was sent or not? I have a method to send maybe I
could put it in here somehow?

def send_initial
UserMailer.deliver_initial(self)
end


#2

Hey David

The only thing I can think of here would be to set action mailer to
raise delivery errors in your development and production environments:
config.action_mailer.raise_delivery_errors = true

and then add something like the following to the method that sends the
mail:

def my_mail_sending_method
begin
Mailer.deliver_my_email
rescue
return false # => returns false if any exceptions are raised
end
return true # => returns true if no exceptions are raised
end

There might be a better answer out there though? :s