0
私はherokuでホストしているアプリケーションに電子メール機能を追加しようとしています。ここでヘイルクを使ってメイラとsendgridをレンダリングする
はrelavantファイルされています。これは、罰金
アプリ/メーラー/ user_actions_mailer.rb
def add_user_action(action_params)
@action_params = action_params
from = Email.new(email: '[email protected]')
subject = 'You have been notified'
to = Email.new(email: '[email protected]')
content = Content.new(type: 'text/html', value: "test")
mail = Mail.new(from, subject, to, content)
sg = SendGrid::API.new(api_key: ENV['SENDGRID_API_KEY'])
response = sg.client.mail._('send').post(request_body: mail.to_json)
end
働いていると私はそれでメールを送信することができています。しかし、私の問題は上記の 'content'変数にあります。私はコンテンツがapp/views/user_actions_mailer/add_user_action.html.erbの標準のメーラテンプレートを使用するようにしたい。
私はこのファイル/フォルダを作成しましたが、この場所にコンテンツをどのように指すかわかりません。私はMail.new fuctionに内容を渡さないようにしようとしています。これは、デフォルトのメーラー配線を引き起こすかもしれないと思っています。