I have mailer:
class AdminMailer < ActionMailer::Base
default :from => "[email protected]"
def message
mail(:to => "[email protected]",:subject => "test")
end
end
When I i use them from the controller :
def create
AdminMailer.message.deliver
redirect_to root_path
end
Then I got
SystemStackError in EmailsController#create
stack level too deep
Without any trace and so on.
I think you'll find the message
method is reserved by Action Mailer. I would recommend calling your method different from this to prevent this conflict.
Thanks to Ben Lee in the comments for pointing out where this comes from.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With