Chatwoot/app/services/whatsapp/providers/base_service.rb
Sojan Jose a6c609f43d
feat: Support for Whatsapp Cloud API (#4938)
Ability to configure Whatsapp Cloud API Inboxes

fixes: #4712
2022-07-06 21:45:03 +02:00

29 lines
911 B
Ruby

#######################################
# To create a whatsapp provider
# - Inherit this as the base class.
# - Implement `send_message` method in your child class.
# - Implement `send_template_message` method in your child class.
# - Implement `sync_templates` method in your child class.
# - Implement `validate_provider_config` method in your child class.
# - Use Childclass.new(whatsapp_channel: channel).perform.
######################################
class Whatsapp::Providers::BaseService
pattr_initialize [:whatsapp_channel!]
def send_message(_phone_number, _message)
raise 'Overwrite this method in child class'
end
def send_template(_phone_number, _template_info)
raise 'Overwrite this method in child class'
end
def sync_template
raise 'Overwrite this method in child class'
end
def validate_provider_config
raise 'Overwrite this method in child class'
end
end