mirror of
https://github.com/docusealco/docuseal
synced 2026-11-05 14:42:33 -05:00
adjust from email
This commit is contained in:
1 parent
e398327fb7
commit
3975a03cb4
3 files changed
+9
-2
No files matched your search
@@ -18,7 +18,11 @@ module ActionMailerConfigsInterceptor
|
||||
if Rails.env.production? && Rails.application.config.action_mailer.delivery_method
|
||||
from = ENV.fetch('SMTP_FROM').to_s.split(',').sample
|
||||
|
||||
message.from = from
|
||||
if from.match?(User::FULL_EMAIL_REGEXP)
|
||||
message[:from] = message[:from].to_s.sub(User::EMAIL_REGEXP, from)
|
||||
else
|
||||
message.from = from
|
||||
end
|
||||
|
||||
if from == 'DocuSeal <info@docuseal.com>'
|
||||
message.body.instance_variable_set(
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
module Params
|
||||
class BaseValidator
|
||||
EMAIL_REGEXP = /\A[a-z0-9][\.']?(?:(?:[a-z0-9_-]+[\.\+'])*[a-z0-9_-]+)*@(?:[a-z0-9]+[\.-])*[a-z0-9]+\.[a-z]{2,}\z/i
|
||||
EMAIL_REGEXP = User::FULL_EMAIL_REGEXP
|
||||
|
||||
InvalidParameterError = Class.new(StandardError)
|
||||
|
||||
|
||||
Reference in new issue
Block a user