adjust smtp from

pull/381/head
Pete Matsyburka 1 year ago
parent 1fc1e9af16
commit 48f3b13f3e

@ -16,7 +16,11 @@ module ActionMailerConfigsInterceptor
end end
if Rails.env.production? && Rails.application.config.action_mailer.delivery_method 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 return message
end end

@ -22,7 +22,7 @@ module ActionMailerEventsObserver
emailable_type:, emailable_type:,
event_type: :send, event_type: :send,
email:, email:,
data: { method: mail.delivery_method.class.name.underscore }, data: { from: mail.from, method: mail.delivery_method.class.name.underscore },
event_datetime: Time.current event_datetime: Time.current
) )
end end

Loading…
Cancel
Save