mirror of
https://github.com/astuto/astuto.git
synced 2025-12-16 03:37:56 +01:00
16 lines
391 B
Ruby
16 lines
391 B
Ruby
class ApplicationMailer < ActionMailer::Base
|
|
layout 'mailer'
|
|
helper :application
|
|
|
|
after_action :set_mail_from_for_multitenancy
|
|
|
|
private
|
|
|
|
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
|