Guest User

Untitled

a guest
Sep 11th, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. Rails: Devise: post-confirmation error
  2. class EventMailer < ActionMailer::Base
  3. @user = User
  4.  
  5. @host_name = "localhost:3000" if Rails.env.development?
  6. @host_name = "test.com" if Rails.env.test?
  7. @host_name = "production.com" if Rails.env.production?
  8.  
  9. def self.send_email_to_admin
  10. @@smtp_settings = { #override default smtp settings since I'm using a difference sender
  11. :address => "smtp.gmail.com",
  12. :port => 587,
  13. :domain => @host_name,
  14.  
  15. :authentication => "plain",
  16. :enable_starttls_auto_=> true,
  17. :user_name => ENV["ORG_FROM"],
  18. :password => ENV["ORG_FROM_PWD"],
  19. :to => ADMIN_RECIPIENTS
  20. #ADMIN_RECIPIENTS is defined elsewhere
  21. }
  22. mail(:subject => "Invite request received from " + @user.first.to_s + " " + @user.last.to_s)
  23. end
  24. end
  25.  
  26. undefined method `mail' for EventMailer:Class
  27.  
  28. app/mailers/event_mailer.rb:20:in `send_email_to_admin'
  29. app/controllers/confirmations_controller.rb:11:in `show'
  30.  
  31. mail(:to => DENT_ADMIN_RECIPIENTS, :subject => "Invite request received from " + @user.first.to_s + " " + @user.last.to_s)
Add Comment
Please, Sign In to add comment