私は、今現在Herokuにsendgripを導入し、サインアップ時に承認メール(メールに届いたurlを押したら、承認されて、ユーザーが使えるようになるシステムです)を送りたいと考えているのですが、エラーが発生して、行かない状態にあります。あと、developmentでは動いたのですが、production・herokuでは動かなくなってしまいました。もしわかる方がいらしたら、ご教授して頂きたいです。どうぞよろしくお願いします。
heroku -logs tail実行後に確認されたエラー
heroku activity
config/environments/production.rb
environments
1config.action_mailer.default_url_options = { :host => '$$$$$$$$$$$$$$.herokuapp.com' } 2 config.action_mailer.delivery_method = :smtp 3 config.action_mailer.perform_deliveries = true 4 config.action_mailer.smtp_settings = { 5 :address => 'smtp.sendgrid.net', 6 :port => '587', 7 :authentication => :plain, 8 :user_name => ENV['SENDGRID_USERNAME'], 9 :password => ENV['SENDGRID_PASSWORD'], 10 :domain => 'heroku.com', 11 :enable_starttls_auto => true 12 }
model/guider.rb
model
1 after_create :send_admin_mail 2 def send_admin_mail 3 AdminMailer.new_guider_waiting_for_approval(self).deliver_now 4 AdminMailer.new_guider_confirmation(self).deliver_now 5 end 6 7 def active_for_authentication? 8 super && approved? 9 end 10 11 def inactive_message 12 approved? ? super : :not_approved 13 end
mailers/admin_maielr.rb
mailer
1 default from: '$$$$$$$$$$$$$$@gmail.com' 2 layout 'mailer' 3 4 def new_guider_waiting_for_approval(guider) 5 @guider = guider 6 mail( 7 from: "<$$$$$$$$$$$$@gmail.com>", 8 to: "<$$$$$$$$$$$$@gmail.com>", 9 subject: 'New User Awaiting Admin Approval' 10 ) 11 end 12 13 def new_guider_confirmation(guider) 14 @guider = guider 15 mail( 16 from: "<$$$$$$$$$$$$$@gmail.com>", 17 to: "<#{@guider.email}>", 18 subject: 'New User Awaiting Admin Approval' 19 ) 20 end
views/admin_mailer/new_guider_waiting_for_approval.html.erb
view
1<p><%= @guider.email %> has registered to join your site!</p> 2 <p>An admin can approve this registration by visiting the website and editing the user</p> 3 <p><%= image_tag(@guider.photo.thumb.url) %><p> 4 <p><%= link_to "approve" , "https://$$$$$$$$$$$$$$$$/guiders/#{@guider.id}/approve" %></p>
views/admin_mailer/new_guider_confirmation.html.erb
view
1<p><%= @guider.email %>さん</p> 2<p>ゴリゴリをご利用いただきありがとうござました。</p> 3<p>会員登録が完了しました</p> 4 <p>登録して頂くために、書類をこちらのメールに送って頂きたいです。</p> 5 <p>$$$$$$$$$$$$$$$$@gmail.com</p>
あなたの回答
tips
プレビュー