[CW-1348] fix: Update email regex validation for contact_inbox (#6705)
This commit is contained in:
@@ -59,10 +59,6 @@ class ContactInbox < ApplicationRecord
|
||||
end
|
||||
end
|
||||
|
||||
def validate_email_source_id
|
||||
errors.add(:source_id, "invalid source id for Email inbox. valid Regex #{Devise.email_regexp}") unless Devise.email_regexp.match?(source_id)
|
||||
end
|
||||
|
||||
def validate_whatsapp_source_id
|
||||
return if WHATSAPP_CHANNEL_REGEX.match?(source_id)
|
||||
|
||||
@@ -71,7 +67,6 @@ class ContactInbox < ApplicationRecord
|
||||
|
||||
def valid_source_id_format?
|
||||
validate_twilio_source_id if inbox.channel_type == 'Channel::TwilioSms'
|
||||
validate_email_source_id if inbox.channel_type == 'Channel::Email'
|
||||
validate_whatsapp_source_id if inbox.channel_type == 'Channel::Whatsapp'
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user