2017-10-18 17 views
0

Deviseを使用中に別の確認メールを送信する必要があります。Deviseで別の確認メールを送信

ユーザーがサブドメインにサインアップすると、別の確認メールが送信され、ユーザーがルートドメインからサインアップすると、別のメールが送信されます。

どうすればこの問題を解決できますか?

編集:

は、私が作成したMyDeviceMailer

class MyDeviseMailer < Devise::Mailer 
    layout 'mailers' 

    # To make sure that your mailer uses the devise views 
    default template_path: 'devise/mailer' 

def confirmation_instructions(record, token, options={}) 
    # Use different e-mail templates for signup e-mail confirmation 
    # and for when a user changes e-mail address. 
    if request.subdomain? 
    options[:template_name] = 'confirmation_instructions_sub' 
    else 
    options[:template_name] = 'confirmation_instructions' 
    end 
    super 
    end 
end 

と私は

を追加私のdevise.rbファイル内

config.mailer = 'MyDeviseMailer'

+1

と置き換えてください。あなたはすでに試したことをお見せできますか? – siegy22

+0

私がこれまで行ったことを追加しました –

答えて

0

[OK]を、ので、私は最終的に解決この問題。これらの複雑さに煩わされる代わりに、確認リンクを

<%= link_to 'Confirm my account', user_confirmation_url(confirmation_token: @token, subdomain: Apartment::Tenant.current) %>