2016-05-04 4 views
0

私はRails 4アプリケーションをセットアップして、deviseメーラーがPostmarkテンプレートを使ってPostmarkを送信する方法を理解しようとしています。Rails、Devise、Postmark Gem - deviseメーラーのポストマークテンプレートの使用

私の宝石ファイルには郵便受けの宝石があります。

確認欄に郵便番号を記入する方法がわからないことを除いて、私はすべて機能しています。私が追加した

<%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %></div> 

To get started, please confirm your account below: 

action_url_Value 

私が代わりにアクションURL値のテンプレートに以下の行を配置する方法を見つけ出すことはできません:消印で

私は、このテンプレートを持っています私の初期化子/ devise.rbに次postmark_devise_mailer.rbで

config.mailer = 'PostmarkDeviseMailer' 

、私が持っている:

class PostmarkDeviseMailer < ActionMailer::Base 
    include Devise::Mailers::Helpers 

    def message 
    mail(
     :subject => 'Hello from Postmark', 
     :to => '[email protected]', 
     :from => '[email protected]', 
     :html_body => '<strong>Hello</strong> dear Postmark user.', 
     :track_opens => 'true') 
    end 
end 


    default from: "[email protected]" 

    def confirmation_instructions(record) 
    devise_mail(record, :confirmation_instructions) 
    end 

    def reset_password_instructions(record) 
    devise_mail(record, :reset_password_instructions) 
    end 

    def unlock_instructions(record) 
    devise_mail(record, :unlock_instructions) 
    end 

次の手順はわかりにくいです。誰も小切手取引電子メールのメーラーとしてPostmarkテンプレートを使用する方法を考え出しましたか?

答えて

0

レスポンス: 残念ながら、Postmarkのテンプレートは伝統的なRailsエコシステムにうまく適合しません。詳細は、ここに私の返事を参照してください:

https://github.com/wildbit/postmark-rails/issues/53

あなたが潜在的にactionmailerのを置き換えますが、それらを一緒に混合することは重要な課題を提示でき消印テンプレートで消印のAPIを使用して、それを要約します。残念ながら、私たちはDeviseで "ActionMailer-free"アプローチを試みたことはありませんでしたので、ここではお手伝いできません。そうしないと良い理由がない限り、私はActionMailerテンプレートを使い、配送用アダプターとして郵便受け宝石を使用することをお勧めします。このアプローチはDeviseとうまくいくことが知られています。ご不明な点がございましたらお知らせください。

関連する問題