From e90ba2fbcb4d8a02b1e39c887d646673757ef706 Mon Sep 17 00:00:00 2001 From: Frederik Wille Date: Wed, 13 Jul 2016 11:25:35 +0200 Subject: [PATCH] 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 --- lib/devise/mailers/helpers.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/devise/mailers/helpers.rb b/lib/devise/mailers/helpers.rb index 79c7c72f..ddf8f2bb 100644 --- a/lib/devise/mailers/helpers.rb +++ b/lib/devise/mailers/helpers.rb @@ -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)