Guest User

Untitled

a guest
Jan 20th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. config.action_mailer.default_url_options = { host: ENV["MY_DOMAIN"] }
  2. config.action_mailer.raise_delivery_errors = true
  3. config.action_mailer.delivery_method = :smtp
  4. config.action_mailer.perform_deliveries = true
  5. config.action_mailer.smtp_settings = {
  6. address: "smtp.gmail.com",
  7. port: 587,
  8. domain: ENV["MY_DOMAIN"],
  9. authentication: "plain",
  10. enable_starttls_auto: true,
  11. user_name: ENV["MY_USERNAME"],
  12. password: ENV["MY_PASSWORD"]
  13. }
  14.  
  15. config.action_mailer.perform_deliveries = target_is_designated_email_address?
  16.  
  17. class DevelopmentMailInterceptor
  18. def self.delivering_email(message)
  19. message.subject = "[#{message.to}] #{message.subject}"
  20. message.to = "eifion@asciicasts.com"
  21. end
  22. end
  23.  
  24. Mail.register_interceptor(DevelopmentMailInterceptor) if Rails.env.development?
Add Comment
Please, Sign In to add comment