adjust smtp from
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user