add block passthrough to devise_mail

ActionMailer's ``mail`` method may receive a block for customizing the mails
format
``devise_mail`` now has the same functionality by just
passing the block to ``mail`` call.

fixes plataformatec/devise#2341
This commit is contained in:
Frederik Wille
2016-07-13 11:25:35 +02:00
parent e6b5f5f31a
commit e90ba2fbcb

View File

@@ -11,9 +11,9 @@ module Devise
protected
# Configure default email options
def devise_mail(record, action, opts={})
def devise_mail(record, action, opts = {}, &block)
initialize_from_record(record)
mail headers_for(action, opts)
mail headers_for(action, opts), &block
end
def initialize_from_record(record)