chore: Whatsapp templates fix for 360 dialog (#3479)

Fixes: #3426
This commit is contained in:
Sojan Jose
2021-11-30 20:50:35 +05:30
committed by GitHub
parent 0899f62912
commit d5c30760a7
7 changed files with 215 additions and 17 deletions

View File

@@ -3,6 +3,27 @@ FactoryBot.define do
sequence(:phone_number) { |n| "+123456789#{n}1" }
account
provider_config { { 'api_key' => 'test_key' } }
message_templates do
[{ 'name' => 'sample_shipping_confirmation',
'status' => 'approved',
'category' => 'SHIPPING_UPDATE',
'language' => 'id',
'namespace' => '2342384942_32423423_23423fdsdaf',
'components' =>
[{ 'text' => 'Paket Anda sudah dikirim. Paket akan sampai dalam {{1}} hari kerja.', 'type' => 'BODY' },
{ 'text' => 'Pesan ini berasal dari bisnis yang tidak terverifikasi.', 'type' => 'FOOTER' }],
'rejected_reason' => 'NONE' },
{ 'name' => 'sample_shipping_confirmation',
'status' => 'approved',
'category' => 'SHIPPING_UPDATE',
'language' => 'en_US',
'namespace' => '23423423_2342423_324234234_2343224',
'components' =>
[{ 'text' => 'Your package has been shipped. It will be delivered in {{1}} business days.', 'type' => 'BODY' },
{ 'text' => 'This message is from an unverified business.', 'type' => 'FOOTER' }],
'rejected_reason' => 'NONE' }]
end
message_templates_last_updated { Time.now.utc }
after(:create) do |channel_whatsapp|
create(:inbox, channel: channel_whatsapp, account: channel_whatsapp.account)