mirror of
https://github.com/astuto/astuto.git
synced 2025-12-14 18:57:51 +01:00
14 lines
368 B
Ruby
14 lines
368 B
Ruby
class ApplicationMailer < ActionMailer::Base
|
|
layout 'mailer'
|
|
helper :application
|
|
|
|
after_action :set_mail_from_for_multitenancy
|
|
|
|
def set_mail_from_for_multitenancy
|
|
if Rails.application.multi_tenancy?
|
|
from = "#{Current.tenant_or_raise!.site_name} <#{ENV.fetch('EMAIL_MAIL_FROM', 'notifications@astuto.io')}>"
|
|
mail.from = from
|
|
end
|
|
end
|
|
end
|