adjust smtp from

This commit is contained in:
Pete Matsyburka
2024-10-18 22:58:21 +03:00
parent 1fc1e9af16
commit 48f3b13f3e
2 changed files with 6 additions and 2 deletions
+5 -1
View File
@@ -16,7 +16,11 @@ module ActionMailerConfigsInterceptor
end
if Rails.env.production? && Rails.application.config.action_mailer.delivery_method
message.from = ENV.fetch('SMTP_FROM')
message.from = ENV.fetch('SMTP_FROM').to_s.split(',').sample
if message.from == 'DocuSeal <info@docuseal.com>'
message.body.raw_source.gsub!('https://docuseal.co/', 'https://docuseal.com/')
end
return message
end
+1 -1
View File
@@ -22,7 +22,7 @@ module ActionMailerEventsObserver
emailable_type:,
event_type: :send,
email:,
data: { method: mail.delivery_method.class.name.underscore },
data: { from: mail.from, method: mail.delivery_method.class.name.underscore },
event_datetime: Time.current
)
end