Simplify self host settings controller (#1230)

This commit is contained in:
Zach Gollwitzer
2024-10-02 12:07:56 -04:00
committed by GitHub
parent cb75c537fe
commit 7fabca4679
22 changed files with 252 additions and 399 deletions

View File

@@ -1,16 +1,3 @@
class ApplicationMailer < ActionMailer::Base
layout "mailer"
after_action :set_self_host_settings, if: -> { Rails.configuration.app_mode.self_hosted? }
private
def set_self_host_settings
mail.from = Setting.email_sender
mail.delivery_method.settings.merge!({ address: Setting.smtp_host,
port: Setting.smtp_port,
user_name: Setting.smtp_username,
password: Setting.smtp_password,
tls: ENV.fetch("SMTP_TLS_ENABLED", "true") == "true" })
end
end