Merge branch 'develop' into feat/github-integration
This commit is contained in:
@@ -34,6 +34,7 @@ class Channel::Whatsapp < ApplicationRecord
|
||||
|
||||
after_create :sync_templates
|
||||
after_create_commit :setup_webhooks
|
||||
before_destroy :teardown_webhooks
|
||||
|
||||
def name
|
||||
'Whatsapp'
|
||||
@@ -105,4 +106,8 @@ class Channel::Whatsapp < ApplicationRecord
|
||||
# Don't raise the error to prevent channel creation from failing
|
||||
# Webhooks can be retried later
|
||||
end
|
||||
|
||||
def teardown_webhooks
|
||||
Whatsapp::WebhookTeardownService.new(self).perform
|
||||
end
|
||||
end
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
# Indexes
|
||||
#
|
||||
# index_contacts_on_account_id (account_id)
|
||||
# index_contacts_on_account_id_and_contact_type (account_id,contact_type)
|
||||
# index_contacts_on_account_id_and_last_activity_at (account_id,last_activity_at DESC NULLS LAST)
|
||||
# index_contacts_on_blocked (blocked)
|
||||
# index_contacts_on_lower_email_account_id (lower((email)::text), account_id)
|
||||
@@ -175,8 +176,12 @@ class Contact < ApplicationRecord
|
||||
}
|
||||
end
|
||||
|
||||
def self.resolved_contacts
|
||||
where("contacts.email <> '' OR contacts.phone_number <> '' OR contacts.identifier <> ''")
|
||||
def self.resolved_contacts(use_crm_v2: false)
|
||||
if use_crm_v2
|
||||
where(contact_type: 'lead')
|
||||
else
|
||||
where("contacts.email <> '' OR contacts.phone_number <> '' OR contacts.identifier <> ''")
|
||||
end
|
||||
end
|
||||
|
||||
def discard_invalid_attrs
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
# name :string not null
|
||||
# page_title :string
|
||||
# slug :string not null
|
||||
# ssl_settings :jsonb not null
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# account_id :integer not null
|
||||
@@ -69,3 +70,5 @@ class Portal < ApplicationRecord
|
||||
errors.add(:cofig, "in portal on #{denied_keys.join(',')} is not supported.") if denied_keys.any?
|
||||
end
|
||||
end
|
||||
|
||||
Portal.include_mod_with('Concerns::Portal')
|
||||
|
||||
Reference in New Issue
Block a user